home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: SHell self-extracting ARchive
(archive/shar).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| shell archive text
| default
| |
99%
| file
| POSIX shell script text executable
| default
| |
98%
| file
| a /bin/sh script, ASCII text executable
| default (weak)
| |
63%
| TrID
| Linux/UNIX shell script
| default
| |
36%
| TrID
| Perl script
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| gt2
| Shell Skript: '/bin/sh'
| default (weak)
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| binwalkID
| Executable script, shebang: "/bin/sh"
| default (weak)
| |
100%
| xdgMime
| application/x-shellscript
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 23 21 2f 62 69 6e 2f 73 | 68 0a 23 20 54 68 69 73 |#!/bin/s|h.# This|
|00000010| 20 69 73 20 61 20 73 68 | 65 6c 6c 20 61 72 63 68 | is a sh|ell arch|
|00000020| 69 76 65 20 28 70 72 6f | 64 75 63 65 64 20 62 79 |ive (pro|duced by|
|00000030| 20 73 68 61 72 20 33 2e | 34 39 29 0a 23 20 54 6f | shar 3.|49).# To|
|00000040| 20 65 78 74 72 61 63 74 | 20 74 68 65 20 66 69 6c | extract| the fil|
|00000050| 65 73 20 66 72 6f 6d 20 | 74 68 69 73 20 61 72 63 |es from |this arc|
|00000060| 68 69 76 65 2c 20 73 61 | 76 65 20 69 74 20 74 6f |hive, sa|ve it to|
|00000070| 20 61 20 66 69 6c 65 2c | 20 72 65 6d 6f 76 65 0a | a file,| remove.|
|00000080| 23 20 65 76 65 72 79 74 | 68 69 6e 67 20 61 62 6f |# everyt|hing abo|
|00000090| 76 65 20 74 68 65 20 22 | 21 2f 62 69 6e 2f 73 68 |ve the "|!/bin/sh|
|000000a0| 22 20 6c 69 6e 65 20 61 | 62 6f 76 65 2c 20 61 6e |" line a|bove, an|
|000000b0| 64 20 74 79 70 65 20 22 | 73 68 20 66 69 6c 65 5f |d type "|sh file_|
|000000c0| 6e 61 6d 65 22 2e 0a 23 | 0a 23 20 6d 61 64 65 20 |name"..#|.# made |
|000000d0| 30 31 2f 30 39 2f 31 39 | 39 31 20 31 35 3a 30 34 |01/09/19|91 15:04|
|000000e0| 20 55 54 43 20 62 79 20 | 64 66 40 64 65 61 74 68 | UTC by |df@death|
|000000f0| 2e 63 65 72 74 2e 73 65 | 69 2e 63 6d 75 2e 65 64 |.cert.se|i.cmu.ed|
|00000100| 75 0a 23 0a 23 20 65 78 | 69 73 74 69 6e 67 20 66 |u.#.# ex|isting f|
|00000110| 69 6c 65 73 20 77 69 6c | 6c 20 4e 4f 54 20 62 65 |iles wil|l NOT be|
|00000120| 20 6f 76 65 72 77 72 69 | 74 74 65 6e 20 75 6e 6c | overwri|tten unl|
|00000130| 65 73 73 20 2d 63 20 69 | 73 20 73 70 65 63 69 66 |ess -c i|s specif|
|00000140| 69 65 64 0a 23 0a 23 20 | 54 68 69 73 20 73 68 61 |ied.#.# |This sha|
|00000150| 72 20 63 6f 6e 74 61 69 | 6e 73 3a 0a 23 20 6c 65 |r contai|ns:.# le|
|00000160| 6e 67 74 68 20 20 6d 6f | 64 65 20 20 20 20 20 20 |ngth mo|de |
|00000170| 20 6e 61 6d 65 0a 23 20 | 2d 2d 2d 2d 2d 2d 20 2d | name.# |------ -|
|00000180| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 20 2d 2d 2d 2d 2d 2d |--------|- ------|
|00000190| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000001a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000001b0| 2d 2d 2d 2d 0a 23 20 20 | 20 39 37 38 32 20 2d 72 |----.# | 9782 -r|
|000001c0| 77 2d 2d 2d 2d 2d 2d 2d | 20 52 45 41 44 4d 45 2e |w-------| README.|
|000001d0| 70 65 72 6c 0a 23 20 20 | 20 31 37 37 36 20 2d 72 |perl.# | 1776 -r|
|000001e0| 77 78 2d 2d 2d 2d 2d 2d | 20 67 65 74 2d 63 66 0a |wx------| get-cf.|
|000001f0| 23 20 20 20 36 34 39 30 | 20 2d 72 77 2d 2d 2d 2d |# 6490| -rw----|
|00000200| 2d 2d 2d 20 6b 75 61 6e | 67 2e 31 0a 23 20 20 31 |--- kuan|g.1.# 1|
|00000210| 36 39 32 35 20 2d 72 77 | 78 2d 2d 2d 2d 2d 2d 20 |6925 -rw|x------ |
|00000220| 6b 75 61 6e 67 2e 70 6c | 0a 23 20 20 20 20 32 38 |kuang.pl|.# 28|
|00000230| 34 20 2d 72 77 78 2d 2d | 2d 2d 2d 2d 20 6b 75 61 |4 -rwx--|---- kua|
|00000240| 6e 67 5f 61 6c 6c 0a 23 | 20 20 20 31 33 30 37 20 |ng_all.#| 1307 |
|00000250| 2d 72 77 2d 2d 2d 2d 2d | 2d 2d 20 70 75 74 2d 63 |-rw-----|-- put-c|
|00000260| 66 0a 23 20 20 20 31 32 | 37 34 20 2d 72 77 2d 2d |f.# 12|74 -rw--|
|00000270| 2d 2d 2d 2d 2d 20 79 61 | 67 72 69 70 2e 70 6c 0a |----- ya|grip.pl.|
|00000280| 23 0a 23 20 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |#.# ====|========|
|00000290| 3d 20 52 45 41 44 4d 45 | 2e 70 65 72 6c 20 3d 3d |= README|.perl ==|
|000002a0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 0a 69 66 20 |========|====.if |
|000002b0| 74 65 73 74 20 2d 66 20 | 27 52 45 41 44 4d 45 2e |test -f |'README.|
|000002c0| 70 65 72 6c 27 20 2d 61 | 20 58 22 24 31 22 20 21 |perl' -a| X"$1" !|
|000002d0| 3d 20 58 22 2d 63 22 3b | 20 74 68 65 6e 0a 09 65 |= X"-c";| then..e|
|000002e0| 63 68 6f 20 27 78 20 2d | 20 73 6b 69 70 70 69 6e |cho 'x -| skippin|
|000002f0| 67 20 52 45 41 44 4d 45 | 2e 70 65 72 6c 20 28 46 |g README|.perl (F|
|00000300| 69 6c 65 20 61 6c 72 65 | 61 64 79 20 65 78 69 73 |ile alre|ady exis|
|00000310| 74 73 29 27 0a 65 6c 73 | 65 0a 65 63 68 6f 20 27 |ts)'.els|e.echo '|
|00000320| 78 20 2d 20 65 78 74 72 | 61 63 74 69 6e 67 20 52 |x - extr|acting R|
|00000330| 45 41 44 4d 45 2e 70 65 | 72 6c 20 28 54 65 78 74 |EADME.pe|rl (Text|
|00000340| 29 27 0a 73 65 64 20 27 | 73 2f 5e 58 2f 2f 27 20 |)'.sed '|s/^X//' |
|00000350| 3c 3c 20 27 53 48 41 52 | 5f 45 4f 46 27 20 3e 20 |<< 'SHAR|_EOF' > |
|00000360| 27 52 45 41 44 4d 45 2e | 70 65 72 6c 27 20 26 26 |'README.|perl' &&|
|00000370| 0a 58 54 68 69 73 20 69 | 73 20 61 20 70 65 72 6c |.XThis i|s a perl|
|00000380| 20 76 65 72 73 69 6f 6e | 20 6f 66 20 44 61 6e 27 | version| of Dan'|
|00000390| 73 20 76 65 72 73 69 6f | 6e 20 6f 66 20 42 6f 62 |s versio|n of Bob|
|000003a0| 20 42 61 6c 64 77 69 6e | 27 73 20 4b 75 61 6e 67 | Baldwin|'s Kuang|
|000003b0| 20 70 72 6f 67 72 61 6d | 0a 58 28 6f 72 69 67 69 | program|.X(origi|
|000003c0| 6e 61 6c 6c 79 20 77 72 | 69 74 74 65 6e 20 61 73 |nally wr|itten as|
|000003d0| 20 73 6f 6d 65 20 73 68 | 65 6c 6c 20 73 63 72 69 | some sh|ell scri|
|000003e0| 70 74 73 20 61 6e 64 20 | 43 20 70 72 6f 67 72 61 |pts and |C progra|
|000003f0| 6d 73 29 2e 20 0a 58 0a | 58 54 68 65 20 6f 72 69 |ms). .X.|XThe ori|
|00000400| 67 69 6e 61 6c 20 69 6e | 74 65 6e 74 20 77 61 73 |ginal in|tent was|
|00000410| 20 74 6f 20 69 6d 70 72 | 6f 76 65 20 74 68 65 20 | to impr|ove the |
|00000420| 73 70 65 65 64 20 6f 66 | 20 6b 75 61 6e 67 2c 20 |speed of| kuang, |
|00000430| 77 68 69 63 68 20 69 73 | 0a 58 65 73 70 65 63 69 |which is|.Xespeci|
|00000440| 61 6c 6c 79 20 69 6d 70 | 6f 72 74 61 6e 74 20 66 |ally imp|ortant f|
|00000450| 6f 72 20 69 6e 73 74 61 | 6c 6c 61 74 69 6f 6e 73 |or insta|llations|
|00000460| 20 6c 69 6b 65 20 6f 75 | 72 73 20 77 69 74 68 20 | like ou|rs with |
|00000470| 73 65 76 65 72 61 6c 20 | 74 68 6f 75 73 61 6e 64 |several |thousand|
|00000480| 0a 58 61 63 63 6f 75 6e | 74 73 20 61 6e 64 20 4e |.Xaccoun|ts and N|
|00000490| 46 53 20 74 68 69 6e 67 | 73 20 61 6e 64 20 61 6c |FS thing|s and al|
|000004a0| 6c 20 74 68 61 74 2e 20 | 20 54 68 65 20 73 68 65 |l that. | The she|
|000004b0| 6c 6c 20 76 65 72 73 69 | 6f 6e 20 6f 66 20 4b 75 |ll versi|on of Ku|
|000004c0| 61 6e 67 20 75 73 65 64 | 0a 58 43 20 70 72 6f 67 |ang used|.XC prog|
|000004d0| 72 61 6d 73 20 74 6f 20 | 61 64 64 20 72 75 6c 65 |rams to |add rule|
|000004e0| 73 2c 20 67 65 74 20 61 | 20 67 72 6f 75 70 73 20 |s, get a| groups |
|000004f0| 6d 65 6d 62 65 72 73 2c | 20 64 65 74 65 72 6d 69 |members,| determi|
|00000500| 6e 65 20 74 68 65 20 77 | 72 69 74 65 72 73 0a 58 |ne the w|riters.X|
|00000510| 6f 66 20 61 20 66 69 6c | 65 2c 20 61 6e 64 20 73 |of a fil|e, and s|
|00000520| 6f 20 6f 6e 2c 20 77 68 | 69 63 68 20 72 65 61 6c |o on, wh|ich real|
|00000530| 6c 79 20 73 6c 6f 77 65 | 64 20 74 68 69 6e 67 73 |ly slowe|d things|
|00000540| 20 64 6f 77 6e 2e 0a 58 | 0a 58 09 09 22 6e 6f 22 | down..X|.X.."no"|
|00000550| 20 70 72 6f 62 6c 65 6d | 73 09 2f 65 74 63 20 73 | problem|s./etc s|
|00000560| 74 61 66 66 20 77 72 69 | 74 65 61 62 6c 65 0a 58 |taff wri|teable.X|
|00000570| 09 09 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 09 |..------|-------.|
|00000580| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000590| 2d 2d 2d 2d 0a 58 73 68 | 65 6c 6c 20 6b 75 61 6e |----.Xsh|ell kuan|
|000005a0| 67 09 32 3a 31 34 20 28 | 31 34 29 09 31 32 3a 32 |g.2:14 (|14).12:2|
|000005b0| 36 20 28 39 38 29 09 30 | 2e 31 20 70 2f 73 0a 58 |6 (98).0|.1 p/s.X|
|000005c0| 70 65 72 6c 20 6b 75 61 | 6e 67 09 31 3a 31 30 20 |perl kua|ng.1:10 |
|000005d0| 28 31 38 29 09 20 32 3a | 33 34 20 28 35 38 38 29 |(18). 2:|34 (588)|
|000005e0| 09 33 2e 38 20 70 2f 73 | 0a 58 0a 58 54 68 65 20 |.3.8 p/s|.X.XThe |
|000005f0| 22 6e 6f 22 20 70 72 6f | 62 6c 65 6d 73 20 63 6f |"no" pro|blems co|
|00000600| 6c 75 6d 6e 20 69 6e 64 | 69 63 61 74 65 73 20 74 |lumn ind|icates t|
|00000610| 68 65 20 74 69 6d 65 20 | 74 61 6b 65 6e 20 28 61 |he time |taken (a|
|00000620| 6e 64 20 6e 75 6d 62 65 | 72 20 6f 66 20 70 6c 61 |nd numbe|r of pla|
|00000630| 6e 73 0a 58 63 6f 6e 73 | 69 64 65 72 65 64 29 20 |ns.Xcons|idered) |
|00000640| 66 6f 72 20 74 68 65 20 | 73 68 65 6c 6c 20 61 6e |for the |shell an|
|00000650| 64 20 50 65 72 6c 20 76 | 65 72 73 69 6f 6e 73 20 |d Perl v|ersions |
|00000660| 6f 66 20 4b 75 61 6e 67 | 20 6f 6e 20 61 20 73 79 |of Kuang| on a sy|
|00000670| 73 74 65 6d 20 77 69 74 | 68 0a 58 6e 6f 20 6b 6e |stem wit|h.Xno kn|
|00000680| 6f 77 6e 20 73 65 63 75 | 72 69 74 79 20 70 72 6f |own secu|rity pro|
|00000690| 62 6c 65 6d 73 2e 20 20 | 54 68 65 20 22 2f 65 74 |blems. |The "/et|
|000006a0| 63 20 73 74 61 66 66 20 | 77 72 69 74 65 61 62 6c |c staff |writeabl|
|000006b0| 65 22 20 63 6f 6c 75 6d | 6e 20 67 69 76 65 73 0a |e" colum|n gives.|
|000006c0| 58 74 69 6d 69 6e 67 20 | 61 6e 64 20 23 20 6f 66 |Xtiming |and # of|
|000006d0| 20 70 6c 61 6e 73 20 66 | 6f 72 20 61 20 73 79 73 | plans f|or a sys|
|000006e0| 74 65 6d 20 77 69 74 68 | 20 61 20 2f 65 74 63 20 |tem with| a /etc |
|000006f0| 64 69 72 65 63 74 6f 72 | 79 20 74 68 61 74 20 69 |director|y that i|
|00000700| 73 0a 58 77 72 69 74 65 | 61 62 6c 65 20 62 79 20 |s.Xwrite|able by |
|00000710| 67 72 6f 75 70 20 73 74 | 61 66 66 2c 20 77 68 69 |group st|aff, whi|
|00000720| 63 68 20 63 6f 6e 74 61 | 69 6e 73 20 73 65 76 65 |ch conta|ins seve|
|00000730| 72 61 6c 20 64 6f 7a 65 | 6e 20 75 73 65 72 73 2e |ral doze|n users.|
|00000740| 0a 58 0a 58 41 73 20 79 | 6f 75 20 63 61 6e 20 73 |.X.XAs y|ou can s|
|00000750| 65 65 2c 20 74 68 65 20 | 50 65 72 6c 20 76 65 72 |ee, the |Perl ver|
|00000760| 73 69 6f 6e 20 69 73 20 | 61 20 62 69 74 20 66 61 |sion is |a bit fa|
|00000770| 73 74 65 72 2e 20 20 54 | 75 72 6e 73 20 6f 75 74 |ster. T|urns out|
|00000780| 20 74 68 65 72 65 20 61 | 72 65 0a 58 61 6c 6c 20 | there a|re.Xall |
|00000790| 73 6f 72 74 73 20 6f 66 | 20 64 65 74 61 69 6c 73 |sorts of| details|
|000007a0| 20 74 68 61 74 20 6e 65 | 65 64 20 74 6f 20 62 65 | that ne|ed to be|
|000007b0| 20 63 6f 6e 73 69 64 65 | 72 65 64 20 69 6e 20 72 | conside|red in r|
|000007c0| 65 61 6c 0a 58 69 6d 70 | 6c 65 6d 65 6e 74 61 74 |eal.Ximp|lementat|
|000007d0| 69 6f 6e 73 20 6f 66 20 | 4b 75 61 6e 67 20 74 79 |ions of |Kuang ty|
|000007e0| 70 65 20 70 72 6f 67 72 | 61 6d 73 2c 20 73 6f 6d |pe progr|ams, som|
|000007f0| 65 20 6f 66 20 77 68 69 | 63 68 20 61 72 65 20 64 |e of whi|ch are d|
|00000800| 69 73 63 75 73 73 65 64 | 0a 58 62 65 6c 6f 77 2e |iscussed|.Xbelow.|
|00000810| 0a 58 0a 58 20 20 2d 2d | 2d 20 53 74 65 76 65 20 |.X.X --|- Steve |
|00000820| 52 6f 6d 69 67 2c 20 43 | 49 53 2c 20 4f 68 69 6f |Romig, C|IS, Ohio|
|00000830| 20 53 74 61 74 65 2c 20 | 4f 63 74 6f 62 65 72 20 | State, |October |
|00000840| 31 39 39 30 0a 58 0a 58 | 2d 2d 2d 2d 2d 2d 2d 2d |1990.X.X|--------|
|00000850| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000860| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000870| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000880| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000890| 2d 2d 2d 2d 2d 2d 0a 58 | 0a 58 53 6f 6d 65 20 46 |------.X|.XSome F|
|000008a0| 65 61 74 75 72 65 73 20 | 6f 66 20 74 68 65 20 50 |eatures |of the P|
|000008b0| 65 72 6c 20 56 65 72 73 | 69 6f 6e 0a 58 0a 58 20 |erl Vers|ion.X.X |
|000008c0| 20 43 61 63 68 65 73 20 | 70 61 73 73 77 64 2f 67 | Caches |passwd/g|
|000008d0| 72 6f 75 70 20 66 69 6c | 65 20 65 6e 74 72 69 65 |roup fil|e entrie|
|000008e0| 73 20 69 6e 20 61 6e 20 | 61 73 73 6f 63 69 61 74 |s in an |associat|
|000008f0| 69 76 65 20 61 72 72 61 | 79 20 66 6f 72 20 66 61 |ive arra|y for fa|
|00000900| 73 74 65 72 0a 58 20 20 | 6c 6f 6f 6b 75 70 73 2e |ster.X |lookups.|
|00000910| 20 20 54 68 69 73 20 69 | 73 20 70 61 72 74 69 63 | This i|s partic|
|00000920| 75 6c 61 72 6c 79 20 68 | 65 6c 70 66 75 6c 20 6f |ularly h|elpful o|
|00000930| 6e 20 69 6e 73 65 63 75 | 72 65 20 73 79 73 74 65 |n insecu|re syste|
|00000940| 6d 73 20 75 73 69 6e 67 | 20 59 50 0a 58 20 20 77 |ms using| YP.X w|
|00000950| 68 65 72 65 20 70 61 73 | 73 77 6f 72 64 20 61 6e |here pas|sword an|
|00000960| 64 20 67 72 6f 75 70 20 | 6c 6f 6f 6b 75 70 73 20 |d group |lookups |
|00000970| 61 72 65 20 73 6c 6f 77 | 20 61 6e 64 20 79 6f 75 |are slow| and you|
|00000980| 20 68 61 76 65 20 74 6f | 20 64 6f 20 61 20 6c 6f | have to| do a lo|
|00000990| 74 20 6f 66 0a 58 20 20 | 74 68 65 6d 2e 2e 2e 3a |t of.X |them...:|
|000009a0| 2d 29 0a 58 0a 58 20 20 | 43 61 6e 20 73 70 65 63 |-).X.X |Can spec|
|000009b0| 69 66 79 20 74 61 72 67 | 65 74 20 28 75 69 64 20 |ify targ|et (uid |
|000009c0| 6f 72 20 67 69 64 29 20 | 6f 6e 20 63 6f 6d 6d 61 |or gid) |on comma|
|000009d0| 6e 64 20 6c 69 6e 65 2e | 0a 58 0a 58 20 20 43 61 |nd line.|.X.X Ca|
|000009e0| 6e 20 75 73 65 20 2d 6c | 20 6f 70 74 69 6f 6e 20 |n use -l| option |
|000009f0| 74 6f 20 67 65 6e 65 72 | 61 74 65 20 50 41 54 20 |to gener|ate PAT |
|00000a00| 66 6f 72 20 61 20 67 6f | 61 6c 2e 0a 58 0a 58 20 |for a go|al..X.X |
|00000a10| 20 43 61 6e 20 75 73 65 | 20 2d 66 20 74 6f 20 70 | Can use| -f to p|
|00000a20| 72 65 6c 6f 61 64 20 66 | 69 6c 65 20 6f 77 6e 65 |reload f|ile owne|
|00000a30| 72 2c 20 67 72 6f 75 70 | 20 61 6e 64 20 6d 6f 64 |r, group| and mod|
|00000a40| 65 20 69 6e 66 6f 2c 20 | 77 68 69 63 68 20 69 73 |e info, |which is|
|00000a50| 0a 58 20 20 68 65 6c 70 | 66 75 6c 20 69 6e 20 73 |.X help|ful in s|
|00000a60| 70 65 65 64 69 6e 67 20 | 74 68 69 6e 67 73 20 75 |peeding |things u|
|00000a70| 70 20 61 6e 64 20 69 6e | 20 61 76 6f 69 64 69 6e |p and in| avoidin|
|00000a80| 67 20 66 69 6c 65 20 73 | 79 73 74 65 6d 0a 58 20 |g file s|ystem.X |
|00000a90| 20 27 73 68 61 64 6f 77 | 73 27 2e 2e 2e 20 20 53 | 'shadow|s'... S|
|00000aa0| 65 65 20 74 68 65 20 6d | 61 6e 20 70 61 67 65 20 |ee the m|an page |
|00000ab0| 66 6f 72 20 64 65 74 61 | 69 6c 73 2e 0a 58 0a 58 |for deta|ils..X.X|
|00000ac0| 46 75 74 75 72 65 20 70 | 6c 61 6e 73 2c 20 74 68 |Future p|lans, th|
|00000ad0| 69 6e 67 73 20 74 6f 20 | 66 69 78 3a 0a 58 0a 58 |ings to |fix:.X.X|
|00000ae0| 2d 20 41 6e 20 65 61 72 | 6c 69 65 72 20 76 65 72 |- An ear|lier ver|
|00000af0| 73 69 6f 6e 20 73 63 61 | 6e 6e 65 64 20 74 68 65 |sion sca|nned the|
|00000b00| 20 70 61 73 73 77 6f 72 | 64 20 66 69 6c 65 20 6c | passwor|d file l|
|00000b10| 6f 6f 6b 69 6e 67 20 66 | 6f 72 20 67 65 6e 65 72 |ooking f|or gener|
|00000b20| 61 6c 6c 79 0a 58 20 20 | 61 63 63 65 73 73 69 62 |ally.X |accessib|
|00000b30| 6c 65 20 61 63 63 6f 75 | 6e 74 73 20 28 6e 6f 20 |le accou|nts (no |
|00000b40| 70 61 73 73 77 6f 72 64 | 29 2c 20 77 68 69 63 68 |password|), which|
|00000b50| 20 77 6f 75 6c 64 20 62 | 65 20 61 64 64 65 64 20 | would b|e added |
|00000b60| 74 6f 20 74 68 65 0a 58 | 20 20 75 69 64 73 2e 6b |to the.X| uids.k|
|00000b70| 6e 6f 77 6e 20 6c 69 73 | 74 20 28 69 6e 20 61 64 |nown lis|t (in ad|
|00000b80| 64 69 74 69 6f 6e 20 74 | 6f 20 2d 31 2c 20 22 6f |dition t|o -1, "o|
|00000b90| 74 68 65 72 22 29 2e 20 | 20 49 20 68 61 64 20 70 |ther"). | I had p|
|00000ba0| 6c 61 6e 6e 65 64 20 6f | 6e 20 61 6c 73 6f 0a 58 |lanned o|n also.X|
|00000bb0| 20 20 61 64 64 69 6e 67 | 20 61 20 70 61 73 73 77 | adding| a passw|
|00000bc0| 6f 72 64 20 63 68 65 63 | 6b 65 72 20 77 68 69 63 |ord chec|ker whic|
|00000bd0| 68 20 77 6f 75 6c 64 20 | 61 6c 6c 6f 77 20 75 73 |h would |allow us|
|00000be0| 20 74 6f 20 61 6c 73 6f | 20 61 64 64 20 61 63 63 | to also| add acc|
|00000bf0| 6f 75 6e 74 73 0a 58 20 | 20 77 69 74 68 20 65 61 |ounts.X | with ea|
|00000c00| 73 69 6c 79 20 67 75 65 | 73 73 65 64 20 70 61 73 |sily gue|ssed pas|
|00000c10| 73 77 6f 72 64 73 2e 20 | 20 45 76 65 6e 74 75 61 |swords. | Eventua|
|00000c20| 6c 6c 79 20 49 20 6e 75 | 6b 65 64 20 74 68 65 20 |lly I nu|ked the |
|00000c30| 63 6f 64 65 20 74 68 61 | 74 0a 58 20 20 73 63 61 |code tha|t.X sca|
|00000c40| 6e 6e 65 64 20 74 68 65 | 20 70 61 73 73 77 6f 72 |nned the| passwor|
|00000c50| 64 20 66 69 6c 65 20 74 | 6f 20 73 70 65 65 64 20 |d file t|o speed |
|00000c60| 74 68 69 6e 67 73 20 75 | 70 2c 20 61 6e 64 20 66 |things u|p, and f|
|00000c70| 75 72 74 68 65 72 20 72 | 65 66 6c 65 63 74 69 6f |urther r|eflectio|
|00000c80| 6e 0a 58 20 20 72 65 76 | 65 61 6c 73 20 74 68 61 |n.X rev|eals tha|
|00000c90| 74 20 69 74 20 69 73 6e | 27 74 20 77 69 73 65 20 |t it isn|'t wise |
|00000ca0| 74 6f 20 61 64 64 20 74 | 68 65 20 70 61 73 73 77 |to add t|he passw|
|00000cb0| 6f 72 64 20 73 63 61 6e | 6e 69 6e 67 20 74 6f 20 |ord scan|ning to |
|00000cc0| 4b 75 61 6e 67 0a 58 20 | 20 69 74 73 65 6c 66 20 |Kuang.X | itself |
|00000cd0| 28 73 69 6e 63 65 20 74 | 68 65 72 65 20 61 72 65 |(since t|here are|
|00000ce0| 20 6d 61 6e 79 20 6f 74 | 68 65 72 20 74 68 69 6e | many ot|her thin|
|00000cf0| 67 73 20 74 68 61 74 20 | 6d 69 67 68 74 20 62 65 |gs that |might be|
|00000d00| 20 63 6f 6e 73 69 64 65 | 72 65 64 0a 58 20 20 69 | conside|red.X i|
|00000d10| 6e 20 64 65 74 65 72 6d | 69 6e 69 6e 67 20 77 68 |n determ|ining wh|
|00000d20| 65 74 68 65 72 20 61 6e | 20 61 63 63 6f 75 6e 74 |ether an| account|
|00000d30| 20 69 73 20 61 63 63 65 | 73 73 69 62 6c 65 20 6f | is acce|ssible o|
|00000d40| 72 20 6e 6f 74 2c 20 61 | 6e 64 20 79 6f 75 0a 58 |r not, a|nd you.X|
|00000d50| 20 20 70 72 6f 62 61 62 | 6c 79 20 64 6f 6e 27 74 | probab|ly don't|
|00000d60| 20 77 61 6e 74 20 74 6f | 20 61 64 64 20 74 68 65 | want to| add the|
|00000d70| 6d 20 61 6c 6c 20 74 6f | 20 4b 75 61 6e 67 29 2e |m all to| Kuang).|
|00000d80| 20 20 0a 58 0a 58 20 20 | 41 74 20 73 6f 6d 65 20 | .X.X |At some |
|00000d90| 70 6f 69 6e 74 20 77 65 | 20 73 68 6f 75 6c 64 20 |point we| should |
|00000da0| 61 64 64 20 61 20 63 6f | 6d 6d 61 6e 64 20 6c 69 |add a co|mmand li|
|00000db0| 6e 65 20 6f 70 74 69 6f | 6e 20 74 68 61 74 20 61 |ne optio|n that a|
|00000dc0| 6c 6c 6f 77 73 20 75 73 | 20 74 6f 0a 58 20 20 61 |llows us| to.X a|
|00000dd0| 64 64 20 61 64 64 69 74 | 69 6f 6e 61 6c 20 75 69 |dd addit|ional ui|
|00000de0| 64 27 73 20 28 6f 72 20 | 67 69 64 27 73 3f 29 20 |d's (or |gid's?) |
|00000df0| 74 6f 20 74 68 65 20 75 | 69 64 73 2e 6b 6e 6f 77 |to the u|ids.know|
|00000e00| 6e 20 6c 69 73 74 2e 20 | 20 54 68 61 74 20 77 61 |n list. | That wa|
|00000e10| 79 0a 58 20 20 74 68 65 | 20 75 73 65 72 20 63 6f |y.X the| user co|
|00000e20| 75 6c 64 20 72 75 6e 20 | 73 6f 6d 65 20 6f 74 68 |uld run |some oth|
|00000e30| 65 72 20 74 6f 6f 6c 20 | 74 6f 20 73 63 61 6e 20 |er tool |to scan |
|00000e40| 74 68 65 20 70 61 73 73 | 77 6f 72 64 20 66 69 6c |the pass|word fil|
|00000e50| 65 20 61 6e 64 0a 58 20 | 20 67 65 6e 65 72 61 74 |e and.X | generat|
|00000e60| 65 20 61 20 6c 69 73 74 | 20 6f 66 20 61 63 63 65 |e a list| of acce|
|00000e70| 73 73 69 62 6c 65 20 61 | 63 63 6f 75 6e 74 73 2c |ssible a|ccounts,|
|00000e80| 20 77 68 69 63 68 20 63 | 6f 75 6c 64 20 74 68 65 | which c|ould the|
|00000e90| 6e 20 62 65 20 66 65 64 | 20 74 6f 0a 58 20 20 6b |n be fed| to.X k|
|00000ea0| 75 61 6e 67 2e 20 20 4d | 61 6b 65 73 20 69 74 20 |uang. M|akes it |
|00000eb0| 66 61 73 74 65 72 20 6f | 6e 20 63 6c 69 65 6e 74 |faster o|n client|
|00000ec0| 73 20 75 73 69 6e 67 20 | 59 50 20 73 69 6e 63 65 |s using |YP since|
|00000ed0| 20 6d 6f 73 74 20 6f 66 | 20 74 68 65 0a 58 20 20 | most of| the.X |
|00000ee0| 70 61 73 73 77 6f 72 64 | 20 66 69 6c 65 20 69 73 |password| file is|
|00000ef0| 20 74 68 65 20 73 61 6d | 65 20 66 6f 72 20 61 6c | the sam|e for al|
|00000f00| 6c 20 4e 20 63 6c 69 65 | 6e 74 73 2c 20 77 68 79 |l N clie|nts, why|
|00000f10| 20 73 63 61 6e 20 69 74 | 20 4e 20 74 69 6d 65 73 | scan it| N times|
|00000f20| 2e 0a 58 20 20 54 68 69 | 73 20 77 6f 75 6c 64 20 |..X Thi|s would |
|00000f30| 6d 61 6b 65 20 69 74 20 | 65 61 73 69 65 72 20 66 |make it |easier f|
|00000f40| 6f 72 20 74 68 65 20 4b | 75 61 6e 67 20 75 73 65 |or the K|uang use|
|00000f50| 72 20 74 6f 20 64 6f 20 | 73 6d 61 72 74 65 72 20 |r to do |smarter |
|00000f60| 74 68 69 6e 67 73 0a 58 | 20 20 74 6f 2f 77 69 74 |things.X| to/wit|
|00000f70| 68 20 74 68 65 20 70 61 | 73 73 77 6f 72 64 20 66 |h the pa|ssword f|
|00000f80| 69 6c 65 20 63 68 65 63 | 6b 73 20 28 6c 69 73 74 |ile chec|ks (list|
|00000f90| 20 61 6c 6c 20 61 63 63 | 6f 75 6e 74 73 20 77 69 | all acc|ounts wi|
|00000fa0| 74 68 20 6e 6f 20 70 61 | 73 73 77 6f 72 64 0a 58 |th no pa|ssword.X|
|00000fb0| 20 20 6f 72 20 65 61 73 | 69 6c 79 20 67 75 65 73 | or eas|ily gues|
|00000fc0| 73 65 64 20 70 61 73 73 | 77 6f 72 64 2c 20 66 69 |sed pass|word, fi|
|00000fd0| 6c 74 65 72 20 6f 75 74 | 20 22 6f 6b 22 20 65 6e |lter out| "ok" en|
|00000fe0| 74 72 69 65 73 20 28 65 | 67 2c 20 73 79 6e 63 29 |tries (e|g, sync)|
|00000ff0| 20 61 6e 64 0a 58 20 20 | 65 74 63 2e 29 0a 58 0a | and.X |etc.).X.|
|00001000| 58 2d 20 54 68 69 73 20 | 76 65 72 73 69 6f 6e 20 |X- This |version |
|00001010| 64 6f 65 73 6e 27 74 20 | 64 65 61 6c 20 77 69 74 |doesn't |deal wit|
|00001020| 68 20 75 69 64 27 73 20 | 61 6e 64 20 67 69 64 27 |h uid's |and gid'|
|00001030| 73 20 63 6f 72 72 65 63 | 74 6c 79 2e 20 20 49 66 |s correc|tly. If|
|00001040| 20 74 68 65 72 65 0a 58 | 20 20 61 72 65 20 73 65 | there.X| are se|
|00001050| 76 65 72 61 6c 20 65 6e | 74 72 69 65 73 20 74 68 |veral en|tries th|
|00001060| 61 74 20 6c 69 73 74 20 | 74 68 65 20 73 61 6d 65 |at list |the same|
|00001070| 20 55 49 44 2c 20 62 75 | 74 20 77 69 74 68 20 64 | UID, bu|t with d|
|00001080| 69 66 66 65 72 65 6e 74 | 0a 58 20 20 6e 61 6d 65 |ifferent|.X name|
|00001090| 73 2c 20 64 69 72 65 63 | 74 6f 72 69 65 73 20 61 |s, direc|tories a|
|000010a0| 6e 64 20 73 68 65 6c 6c | 73 2c 20 77 65 27 6c 6c |nd shell|s, we'll|
|000010b0| 20 6f 6e 6c 79 20 63 68 | 65 63 6b 20 70 6c 61 6e | only ch|eck plan|
|000010c0| 73 20 66 6f 72 20 62 65 | 63 6f 6d 69 6e 67 0a 58 |s for be|coming.X|
|000010d0| 20 20 6f 6e 65 20 6f 66 | 20 74 68 65 6d 2c 20 72 | one of| them, r|
|000010e0| 61 74 68 65 72 20 74 68 | 61 6e 20 61 6e 79 20 6f |ather th|an any o|
|000010f0| 66 20 74 68 65 6d 2c 20 | 73 6f 20 73 6f 6d 65 20 |f them, |so some |
|00001100| 70 6f 73 73 69 62 6c 65 | 20 70 6c 61 6e 73 20 61 |possible| plans a|
|00001110| 72 65 6e 27 74 0a 58 20 | 20 65 76 65 6e 20 65 78 |ren't.X | even ex|
|00001120| 61 6d 69 6e 65 64 2e 20 | 20 0a 58 0a 58 20 20 48 |amined. | .X.X H|
|00001130| 6d 6d 6d 2e 2e 2e 74 68 | 69 73 20 69 73 20 65 61 |mmm...th|is is ea|
|00001140| 73 69 65 72 20 74 68 61 | 6e 20 49 20 74 68 6f 75 |sier tha|n I thou|
|00001150| 67 68 74 20 2d 20 77 68 | 65 6e 20 77 65 20 65 76 |ght - wh|en we ev|
|00001160| 61 6c 75 61 74 65 20 73 | 6f 6d 65 20 70 6c 61 6e |aluate s|ome plan|
|00001170| 0a 58 20 20 66 6f 72 20 | 67 72 61 6e 74 69 6e 67 |.X for |granting|
|00001180| 20 61 20 70 61 72 74 69 | 63 75 6c 61 72 20 75 69 | a parti|cular ui|
|00001190| 64 2c 20 77 65 20 6e 65 | 65 64 20 74 6f 20 65 76 |d, we ne|ed to ev|
|000011a0| 61 6c 75 61 74 65 20 70 | 6c 61 6e 73 20 66 6f 72 |aluate p|lans for|
|000011b0| 20 61 6c 6c 0a 58 20 20 | 75 73 65 72 6e 61 6d 65 | all.X |username|
|000011c0| 73 20 74 68 61 74 20 63 | 61 6e 20 62 65 63 6f 6d |s that c|an becom|
|000011d0| 65 20 74 68 61 74 20 75 | 69 64 2e 20 20 4a 75 73 |e that u|id. Jus|
|000011e0| 74 20 73 74 69 63 6b 20 | 61 20 6c 6f 6f 70 20 69 |t stick |a loop i|
|000011f0| 6e 20 74 68 65 72 65 0a | 58 20 20 73 6f 6d 65 77 |n there.|X somew|
|00001200| 68 65 72 65 2e 2e 2e 67 | 65 74 20 43 46 27 73 20 |here...g|et CF's |
|00001210| 66 6f 72 20 65 61 63 68 | 20 6f 66 20 75 73 65 72 |for each| of user|
|00001220| 6e 61 6d 65 27 73 20 69 | 6e 20 74 75 72 6e 2e 20 |name's i|n turn. |
|00001230| 20 0a 58 0a 58 20 20 42 | 61 68 2c 20 68 61 72 64 | .X.X B|ah, hard|
|00001240| 65 72 20 74 68 61 6e 20 | 49 20 74 68 6f 75 67 68 |er than |I though|
|00001250| 74 2c 20 73 69 6e 63 65 | 20 69 74 27 64 20 68 61 |t, since| it'd ha|
|00001260| 76 65 20 74 6f 20 73 63 | 61 6e 20 74 68 65 20 77 |ve to sc|an the w|
|00001270| 68 6f 6c 65 0a 58 20 20 | 70 61 73 73 77 6f 72 64 |hole.X |password|
|00001280| 20 66 69 6c 65 20 74 6f | 20 66 69 67 75 72 65 20 | file to| figure |
|00001290| 77 68 69 63 68 20 75 73 | 65 72 6e 61 6d 65 2f 68 |which us|ername/h|
|000012a0| 6f 6d 65 20 64 69 72 65 | 63 74 6f 72 69 65 73 20 |ome dire|ctories |
|000012b0| 63 61 6e 20 62 65 63 6f | 6d 65 0a 58 20 20 77 68 |can beco|me.X wh|
|000012c0| 69 63 68 20 75 69 64 27 | 73 2e 20 20 53 69 6d 69 |ich uid'|s. Simi|
|000012d0| 6c 61 72 6c 79 20 77 69 | 74 68 20 67 72 6f 75 70 |larly wi|th group|
|000012e0| 73 2e 20 20 0a 58 0a 58 | 20 20 43 75 72 72 65 6e |s. .X.X| Curren|
|000012f0| 74 20 70 6c 61 6e 3a 20 | 62 79 20 64 65 66 61 75 |t plan: |by defau|
|00001300| 6c 74 2c 20 6b 75 61 6e | 67 20 77 69 6c 6c 20 68 |lt, kuan|g will h|
|00001310| 61 76 65 20 74 6f 20 73 | 63 61 6e 20 74 68 65 20 |ave to s|can the |
|00001320| 77 68 6f 6c 65 20 70 61 | 73 73 77 6f 72 64 0a 58 |whole pa|ssword.X|
|00001330| 20 20 61 6e 64 20 67 72 | 6f 75 70 20 66 69 6c 65 | and gr|oup file|
|00001340| 73 20 73 6f 20 69 74 20 | 63 61 6e 20 62 65 20 73 |s so it |can be s|
|00001350| 75 72 65 20 74 6f 20 67 | 65 74 20 61 6c 6c 20 70 |ure to g|et all p|
|00001360| 6f 73 73 69 62 6c 65 20 | 77 61 79 73 20 74 6f 20 |ossible |ways to |
|00001370| 62 65 63 6f 6d 65 0a 58 | 20 20 73 6f 6d 65 20 75 |become.X| some u|
|00001380| 69 64 20 6f 72 20 67 69 | 64 2e 20 20 49 6e 74 65 |id or gi|d. Inte|
|00001390| 72 6e 61 6c 6c 79 2c 20 | 72 65 61 6c 6c 79 20 6e |rnally, |really n|
|000013a0| 65 65 64 20 73 65 76 65 | 72 61 6c 20 6c 69 73 74 |eed seve|ral list|
|000013b0| 73 3a 0a 58 0a 58 09 6d | 61 70 70 69 6e 67 20 66 |s:.X.X.m|apping f|
|000013c0| 72 6f 6d 20 75 69 64 20 | 74 6f 20 6c 69 73 74 20 |rom uid |to list |
|000013d0| 6f 66 20 75 73 65 72 6e | 61 6d 65 73 20 74 68 61 |of usern|ames tha|
|000013e0| 74 20 68 61 76 65 20 74 | 68 61 74 20 75 69 64 0a |t have t|hat uid.|
|000013f0| 58 09 6d 61 70 70 69 6e | 67 20 66 72 6f 6d 20 61 |X.mappin|g from a|
|00001400| 20 75 73 65 72 6e 61 6d | 65 20 74 6f 20 68 6f 6d | usernam|e to hom|
|00001410| 65 20 64 69 72 65 63 74 | 6f 72 79 2c 20 73 68 65 |e direct|ory, she|
|00001420| 6c 6c 0a 58 09 6d 61 70 | 70 69 6e 67 20 66 72 6f |ll.X.map|ping fro|
|00001430| 6d 20 67 69 64 20 74 6f | 20 6c 69 73 74 20 6f 66 |m gid to| list of|
|00001440| 20 75 69 64 73 20 74 68 | 61 74 20 68 61 76 65 20 | uids th|at have |
|00001450| 61 63 63 65 73 73 20 74 | 6f 20 74 68 61 74 0a 58 |access t|o that.X|
|00001460| 09 20 20 67 69 64 20 77 | 68 65 6e 20 74 68 65 79 |. gid w|hen they|
|00001470| 20 6c 6f 67 69 6e 20 28 | 65 69 74 68 65 72 20 6d | login (|either m|
|00001480| 65 6d 62 65 72 20 6f 66 | 20 67 72 6f 75 70 20 77 |ember of| group w|
|00001490| 69 74 68 20 74 68 61 74 | 20 67 69 64 20 6f 72 0a |ith that| gid or.|
|000014a0| 58 09 20 20 67 69 76 65 | 6e 20 61 73 20 6c 6f 67 |X. give|n as log|
|000014b0| 69 6e 20 67 72 6f 75 70 | 20 69 6e 20 70 61 73 73 |in group| in pass|
|000014c0| 77 64 20 66 69 6c 65 29 | 0a 58 09 6d 61 70 70 69 |wd file)|.X.mappi|
|000014d0| 6e 67 20 66 72 6f 6d 20 | 67 69 64 20 74 6f 20 6c |ng from |gid to l|
|000014e0| 69 73 74 20 6f 66 20 67 | 72 6f 75 70 20 6e 61 6d |ist of g|roup nam|
|000014f0| 65 73 20 66 6f 72 20 74 | 68 61 74 20 67 69 64 0a |es for t|hat gid.|
|00001500| 58 0a 58 20 20 43 6f 75 | 72 73 65 2c 20 74 68 69 |X.X Cou|rse, thi|
|00001510| 73 20 6d 65 61 6e 73 20 | 74 68 61 74 20 77 65 20 |s means |that we |
|00001520| 68 61 76 65 20 74 6f 20 | 72 65 61 64 20 74 68 65 |have to |read the|
|00001530| 20 77 68 6f 6c 65 20 70 | 61 73 73 77 6f 72 64 20 | whole p|assword |
|00001540| 61 6e 64 20 67 72 6f 75 | 70 0a 58 20 20 66 69 6c |and grou|p.X fil|
|00001550| 65 2c 20 6d 6f 73 74 20 | 6f 66 20 77 68 69 63 68 |e, most |of which|
|00001560| 20 77 69 6c 6c 20 62 65 | 20 63 6f 6d 6d 6f 6e 20 | will be| common |
|00001570| 74 6f 20 6d 61 6e 79 20 | 6d 61 63 68 69 6e 65 73 |to many |machines|
|00001580| 20 28 6c 69 6b 65 20 69 | 6e 20 61 20 59 50 0a 58 | (like i|n a YP.X|
|00001590| 20 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 29 2e 20 | enviro|nment). |
|000015a0| 20 57 65 20 63 6f 75 6c | 64 20 70 72 65 6c 6f 61 | We coul|d preloa|
|000015b0| 64 20 74 68 65 20 74 61 | 62 6c 65 73 20 61 62 6f |d the ta|bles abo|
|000015c0| 76 65 20 66 72 6f 6d 20 | 66 69 6c 65 73 20 63 72 |ve from |files cr|
|000015d0| 65 61 74 65 64 0a 58 20 | 20 6f 6e 63 65 2c 20 63 |eated.X | once, c|
|000015e0| 6f 6e 74 61 69 6e 69 6e | 67 20 74 68 65 20 62 72 |ontainin|g the br|
|000015f0| 75 6e 74 20 6f 66 20 74 | 68 65 20 59 50 20 69 6e |unt of t|he YP in|
|00001600| 66 6f 2c 20 61 6e 64 20 | 74 68 65 6e 20 61 75 67 |fo, and |then aug|
|00001610| 6d 65 6e 74 20 74 68 61 | 74 0a 58 20 20 77 69 74 |ment tha|t.X wit|
|00001620| 68 20 74 68 65 20 6c 6f | 63 61 6c 20 70 61 73 73 |h the lo|cal pass|
|00001630| 77 64 20 61 6e 64 20 67 | 72 6f 75 70 20 69 6e 66 |wd and g|roup inf|
|00001640| 6f 20 6f 6e 20 65 61 63 | 68 20 68 6f 73 74 20 77 |o on eac|h host w|
|00001650| 68 65 6e 20 6b 75 61 6e | 67 20 69 73 0a 58 20 20 |hen kuan|g is.X |
|00001660| 69 6e 76 6f 6b 65 64 2c | 20 62 75 74 20 74 68 65 |invoked,| but the|
|00001670| 6e 20 77 65 20 6e 65 65 | 64 20 74 6f 20 63 6f 72 |n we nee|d to cor|
|00001680| 72 65 63 74 6c 79 20 69 | 6e 74 65 72 70 72 65 74 |rectly i|nterpret|
|00001690| 20 66 75 6e 6b 79 20 59 | 50 20 74 68 69 6e 67 73 | funky Y|P things|
|000016a0| 0a 58 20 20 6c 69 6b 65 | 20 2b 40 6e 65 74 67 72 |.X like| +@netgr|
|000016b0| 6f 75 70 3a 3a 3a 2a 3a | 2e 2e 2e 2c 20 77 68 69 |oup:::*:|..., whi|
|000016c0| 63 68 20 6d 65 61 6e 73 | 20 74 68 61 74 20 74 68 |ch means| that th|
|000016d0| 65 20 75 69 64 20 68 61 | 73 20 61 20 6e 61 6d 65 |e uid ha|s a name|
|000016e0| 20 62 75 74 20 6e 6f 0a | 58 20 20 70 61 73 73 77 | but no.|X passw|
|000016f0| 6f 72 64 20 68 65 72 65 | 2e 2e 2e 61 6e 64 20 73 |ord here|...and s|
|00001700| 69 6d 69 6c 61 72 6c 79 | 20 77 69 74 68 20 73 68 |imilarly| with sh|
|00001710| 65 6c 6c 20 73 75 62 73 | 74 69 74 75 74 69 6f 6e |ell subs|titution|
|00001720| 73 20 61 6e 64 20 73 6f | 20 6f 6e 2e 0a 58 20 20 |s and so| on..X |
|00001730| 42 61 68 2e 20 0a 58 0a | 58 2d 20 49 6e 20 61 20 |Bah. .X.|X- In a |
|00001740| 6c 61 72 67 65 20 65 6e | 76 69 72 6f 6e 6d 65 6e |large en|vironmen|
|00001750| 74 20 28 6c 69 6b 65 20 | 6f 75 72 73 2c 20 32 36 |t (like |ours, 26|
|00001760| 30 2b 20 6d 61 63 68 69 | 6e 65 73 2c 20 33 30 2b |0+ machi|nes, 30+|
|00001770| 20 66 69 6c 65 20 73 79 | 73 74 65 6d 73 0a 58 20 | file sy|stems.X |
|00001780| 20 6f 6e 20 61 73 20 6d | 61 6e 79 20 73 65 72 76 | on as m|any serv|
|00001790| 65 72 73 2c 20 32 30 30 | 30 20 70 61 73 73 77 6f |ers, 200|0 passwo|
|000017a0| 72 64 20 66 69 6c 65 20 | 65 6e 74 72 69 65 73 20 |rd file |entries |
|000017b0| 73 65 72 76 65 64 20 62 | 79 20 59 50 29 20 69 74 |served b|y YP) it|
|000017c0| 0a 58 20 20 77 6f 75 6c | 64 20 62 65 20 6e 69 63 |.X woul|d be nic|
|000017d0| 65 20 74 6f 20 27 70 72 | 65 63 6f 6d 70 75 74 65 |e to 'pr|ecompute|
|000017e0| 27 20 73 75 63 63 65 73 | 73 66 75 6c 20 70 6c 61 |' succes|sful pla|
|000017f0| 6e 73 20 74 68 61 74 20 | 77 6f 75 6c 64 20 62 65 |ns that |would be|
|00001800| 20 63 6f 6d 6d 6f 6e 0a | 58 20 20 74 6f 20 61 6c | common.|X to al|
|00001810| 6c 20 73 79 73 74 65 6d | 73 2e 20 20 49 6e 20 70 |l system|s. In p|
|00001820| 61 72 74 69 63 75 6c 61 | 72 2c 20 70 6c 61 6e 73 |articula|r, plans|
|00001830| 20 66 6f 72 20 62 65 63 | 6f 6d 69 6e 67 20 6d 6f | for bec|oming mo|
|00001840| 73 74 20 6f 66 20 74 68 | 65 20 75 73 65 72 73 0a |st of th|e users.|
|00001850| 58 20 20 77 69 74 68 20 | 68 6f 6d 65 20 64 69 72 |X with |home dir|
|00001860| 65 63 74 6f 72 69 65 73 | 20 6f 6e 20 74 68 65 20 |ectories| on the |
|00001870| 4e 46 53 20 66 69 6c 65 | 20 73 79 73 74 65 6d 73 |NFS file| systems|
|00001880| 20 77 6f 75 6c 64 20 62 | 65 20 75 73 65 66 75 6c | would b|e useful|
|00001890| 2c 20 73 69 6e 63 65 0a | 58 20 20 77 65 20 64 6f |, since.|X we do|
|000018a0| 6e 27 74 20 72 65 61 6c | 6c 79 20 77 61 6e 74 20 |n't real|ly want |
|000018b0| 74 6f 20 72 65 63 68 65 | 63 6b 20 74 68 65 73 65 |to reche|ck these|
|000018c0| 20 6f 6e 20 65 61 63 68 | 20 68 6f 73 74 2e 20 20 | on each| host. |
|000018d0| 59 6f 75 20 77 6f 75 6c | 64 6e 27 74 0a 58 20 20 |You woul|dn't.X |
|000018e0| 77 61 6e 74 20 74 68 65 | 20 70 6c 61 6e 20 74 6f |want the| plan to|
|000018f0| 20 62 65 20 74 6f 6f 20 | 64 65 65 70 20 2d 20 70 | be too |deep - p|
|00001900| 72 6f 62 61 62 6c 79 20 | 73 68 6f 75 6c 64 6e 27 |robably |shouldn'|
|00001910| 74 20 73 70 61 6e 20 6d | 6f 72 65 20 74 68 61 6e |t span m|ore than|
|00001920| 20 32 0a 58 20 20 75 69 | 64 73 20 28 31 20 6f 6e | 2.X ui|ds (1 on|
|00001930| 20 65 61 63 68 20 65 6e | 64 3a 20 67 72 61 6e 74 | each en|d: grant|
|00001940| 20 75 2e 72 6f 6d 69 67 | 20 67 72 61 6e 74 20 67 | u.romig| grant g|
|00001950| 2e 73 74 61 66 66 20 77 | 72 69 74 65 20 7e 66 6f |.staff w|rite ~fo|
|00001960| 6f 2f 2e 6c 6f 67 69 6e | 0a 58 20 20 67 72 61 6e |o/.login|.X gran|
|00001970| 74 20 75 2e 66 6f 6f 29 | 2e 20 20 49 27 6d 20 74 |t u.foo)|. I'm t|
|00001980| 68 69 6e 6b 69 6e 67 20 | 74 68 61 74 20 79 6f 75 |hinking |that you|
|00001990| 20 63 6f 75 6c 64 20 66 | 65 65 64 20 61 20 6c 69 | could f|eed a li|
|000019a0| 73 74 20 6f 66 20 74 68 | 65 73 65 0a 58 20 20 70 |st of th|ese.X p|
|000019b0| 72 65 63 6f 6d 70 75 74 | 65 64 20 70 6c 61 6e 73 |recomput|ed plans|
|000019c0| 20 74 6f 20 6b 75 61 6e | 67 20 61 6e 64 20 61 64 | to kuan|g and ad|
|000019d0| 64 20 73 6f 6d 65 20 63 | 6f 64 65 20 74 68 61 74 |d some c|ode that|
|000019e0| 20 63 61 75 73 65 73 20 | 69 74 20 74 6f 0a 58 20 | causes |it to.X |
|000019f0| 20 73 70 6c 69 63 65 20 | 69 6e 20 72 65 6c 65 76 | splice |in relev|
|00001a00| 61 6e 74 20 70 6c 61 6e | 73 20 77 68 65 72 65 20 |ant plan|s where |
|00001a10| 69 74 20 63 61 6e 20 74 | 6f 20 73 68 6f 72 74 20 |it can t|o short |
|00001a20| 63 75 74 20 74 68 65 20 | 70 6c 61 6e 6e 69 6e 67 |cut the |planning|
|00001a30| 0a 58 20 20 73 74 65 70 | 73 2e 20 20 46 6f 72 20 |.X step|s. For |
|00001a40| 65 78 61 6d 70 6c 65 2c | 20 69 66 20 6f 6e 65 20 |example,| if one |
|00001a50| 6f 66 20 74 68 65 20 70 | 6c 61 6e 73 20 69 6e 20 |of the p|lans in |
|00001a60| 75 69 64 73 2e 6e 65 78 | 74 20 69 73 20 73 6f 6d |uids.nex|t is som|
|00001a70| 65 74 68 69 6e 67 0a 58 | 20 20 6c 69 6b 65 20 22 |ething.X| like "|
|00001a80| 67 72 61 6e 74 20 75 2e | 66 6f 6f 20 2e 2e 2e 22 |grant u.|foo ..."|
|00001a90| 2c 20 61 6e 64 20 49 20 | 68 61 76 65 20 74 68 65 |, and I |have the|
|00001aa0| 20 70 72 65 63 6f 6d 70 | 75 74 65 64 20 70 6c 61 | precomp|uted pla|
|00001ab0| 6e 20 6d 65 6e 74 69 6f | 6e 65 64 0a 58 20 20 61 |n mentio|ned.X a|
|00001ac0| 62 6f 76 65 2c 20 49 20 | 63 6f 75 6c 64 20 73 70 |bove, I |could sp|
|00001ad0| 6c 69 63 65 20 74 68 65 | 20 74 77 6f 3a 20 22 67 |lice the| two: "g|
|00001ae0| 72 61 6e 74 20 75 2e 72 | 6f 6d 69 67 20 67 72 61 |rant u.r|omig gra|
|00001af0| 6e 74 20 67 2e 73 74 61 | 66 66 20 77 72 69 74 65 |nt g.sta|ff write|
|00001b00| 0a 58 20 20 7e 66 6f 6f | 2f 2e 6c 6f 67 69 6e 20 |.X ~foo|/.login |
|00001b10| 67 72 61 6e 74 20 75 2e | 66 6f 6f 20 2e 2e 2e 22 |grant u.|foo ..."|
|00001b20| 20 61 6e 64 20 73 6b 69 | 70 20 61 6c 6c 20 74 68 | and ski|p all th|
|00001b30| 65 20 6e 6f 72 6d 61 6c | 20 73 74 65 70 73 20 74 |e normal| steps t|
|00001b40| 68 61 74 0a 58 20 20 77 | 6f 75 6c 64 27 76 65 20 |hat.X w|ould've |
|00001b50| 62 65 65 6e 20 74 61 6b | 65 6e 20 74 6f 20 67 65 |been tak|en to ge|
|00001b60| 74 20 74 68 65 72 65 2e | 0a 58 0a 58 20 20 49 27 |t there.|.X.X I'|
|00001b70| 6d 20 6e 6f 74 20 73 75 | 72 65 20 74 68 69 73 20 |m not su|re this |
|00001b80| 69 73 20 65 76 65 6e 20 | 66 65 61 73 69 62 6c 65 |is even |feasible|
|00001b90| 20 6f 72 20 75 73 65 66 | 75 6c 2e 20 20 46 6f 6f | or usef|ul. Foo|
|00001ba0| 64 20 66 6f 72 20 74 68 | 6f 75 67 68 74 2e 0a 58 |d for th|ought..X|
|00001bb0| 0a 58 2d 20 48 6d 6d 6d | 2e 2e 2e 74 68 69 6e 6b |.X- Hmmm|...think|
|00001bc0| 69 6e 67 20 61 62 6f 75 | 74 20 69 74 2c 20 69 74 |ing abou|t it, it|
|00001bd0| 20 73 65 65 6d 73 20 6c | 69 6b 65 20 73 6f 6d 65 | seems l|ike some|
|00001be0| 20 6f 66 20 74 68 65 20 | 73 74 65 70 73 20 61 72 | of the |steps ar|
|00001bf0| 65 20 61 20 62 69 74 0a | 58 20 20 74 6f 6f 20 69 |e a bit.|X too i|
|00001c00| 6d 70 6c 69 63 69 74 2e | 2e 2e 6d 61 79 62 65 20 |mplicit.|..maybe |
|00001c10| 74 68 65 20 72 75 6c 65 | 73 20 73 68 6f 75 6c 64 |the rule|s should|
|00001c20| 20 62 65 20 62 72 6f 6b | 65 6e 20 6f 75 74 20 61 | be brok|en out a|
|00001c30| 20 62 69 74 20 6d 6f 72 | 65 2e 0a 58 20 20 54 68 | bit mor|e..X Th|
|00001c40| 61 74 20 77 69 6c 6c 20 | 63 6f 73 74 20 69 6e 20 |at will |cost in |
|00001c50| 70 72 6f 63 65 73 73 69 | 6e 67 20 74 69 6d 65 2c |processi|ng time,|
|00001c60| 20 74 68 6f 75 67 68 2e | 0a 58 0a 58 2d 20 57 6f | though.|.X.X- Wo|
|00001c70| 75 6c 64 20 62 65 20 72 | 65 61 6c 6c 79 2c 20 72 |uld be r|eally, r|
|00001c80| 65 61 6c 6c 79 20 6e 69 | 63 65 20 74 6f 20 62 65 |eally ni|ce to be|
|00001c90| 20 61 62 6c 65 20 74 6f | 20 64 65 61 6c 20 77 69 | able to| deal wi|
|00001ca0| 74 68 20 50 41 54 48 20 | 76 61 72 69 61 62 6c 65 |th PATH |variable|
|00001cb0| 73 0a 58 20 20 2d 20 6c | 6f 63 61 74 69 6f 6e 20 |s.X - l|ocation |
|00001cc0| 6f 66 20 2e 2c 20 77 68 | 6f 20 63 61 6e 20 77 72 |of ., wh|o can wr|
|00001cd0| 69 74 65 20 65 6c 65 6d | 65 6e 74 73 20 6f 66 20 |ite elem|ents of |
|00001ce0| 70 61 74 68 2c 20 65 74 | 63 2e 20 20 42 61 73 69 |path, et|c. Basi|
|00001cf0| 63 20 72 75 6c 65 20 69 | 73 0a 58 20 20 22 61 6e |c rule i|s.X "an|
|00001d00| 79 6f 6e 65 20 77 68 6f | 20 63 61 6e 20 72 65 70 |yone who| can rep|
|00001d10| 6c 61 63 65 20 61 6e 79 | 74 68 69 6e 67 20 69 6e |lace any|thing in|
|00001d20| 20 61 6e 79 20 6f 66 20 | 70 61 74 68 20 64 69 72 | any of |path dir|
|00001d30| 65 63 74 6f 72 69 65 73 | 20 6f 72 20 74 68 65 0a |ectories| or the.|
|00001d40| 58 20 20 70 61 74 68 20 | 64 69 72 65 63 74 6f 72 |X path |director|
|00001d50| 69 65 73 20 74 68 65 6d | 73 65 6c 76 65 73 20 63 |ies them|selves c|
|00001d60| 61 6e 20 62 65 63 6f 6d | 65 20 74 68 61 74 20 50 |an becom|e that P|
|00001d70| 41 54 48 27 73 20 75 73 | 65 72 2e 2e 2e 22 20 20 |ATH's us|er..." |
|00001d80| 54 68 69 73 0a 58 20 20 | 63 61 6e 20 62 65 20 72 |This.X |can be r|
|00001d90| 65 61 6c 6c 79 20 6d 65 | 73 73 79 20 74 68 6f 75 |eally me|ssy thou|
|00001da0| 67 68 20 2d 20 69 6e 20 | 6f 75 72 20 65 6e 76 69 |gh - in |our envi|
|00001db0| 72 6f 6e 6d 65 6e 74 2c | 20 74 68 65 20 70 61 74 |ronment,| the pat|
|00001dc0| 68 20 66 6f 72 20 61 20 | 75 73 65 72 0a 58 20 20 |h for a |user.X |
|00001dd0| 77 69 6c 6c 20 64 65 70 | 65 6e 64 20 6f 6e 20 74 |will dep|end on t|
|00001de0| 68 65 20 61 72 63 68 69 | 74 65 63 74 75 72 65 20 |he archi|tecture |
|00001df0| 74 79 70 65 20 6f 66 20 | 74 68 65 20 6d 61 63 68 |type of |the mach|
|00001e00| 69 6e 65 20 74 68 61 74 | 20 68 65 20 69 73 0a 58 |ine that| he is.X|
|00001e10| 20 20 6c 6f 67 67 65 64 | 20 69 6e 74 6f 2c 20 61 | logged| into, a|
|00001e20| 6e 64 20 74 6f 20 67 65 | 74 20 74 68 65 20 70 61 |nd to ge|t the pa|
|00001e30| 74 68 2c 20 79 6f 75 27 | 64 20 68 61 76 65 20 74 |th, you'|d have t|
|00001e40| 6f 20 72 65 61 64 20 61 | 6e 64 20 69 6e 74 65 72 |o read a|nd inter|
|00001e50| 70 72 65 74 0a 58 20 20 | 68 69 73 20 2e 6c 6f 67 |pret.X |his .log|
|00001e60| 69 6e 20 28 69 6e 63 6c | 75 64 69 6e 67 20 76 61 |in (incl|uding va|
|00001e70| 72 69 61 62 6c 65 20 61 | 73 73 69 67 6e 6d 65 6e |riable a|ssignmen|
|00001e80| 74 73 2c 20 73 6f 75 72 | 63 65 27 73 20 61 6e 64 |ts, sour|ce's and|
|00001e90| 0a 58 20 20 63 6f 6e 64 | 69 74 69 6f 6e 61 6c 73 |.X cond|itionals|
|00001ea0| 29 2e 20 20 55 72 66 2e | 20 20 4f 6e 65 20 77 6f |). Urf.| One wo|
|00001eb0| 6e 64 65 72 73 20 77 68 | 65 74 68 65 72 20 69 74 |nders wh|ether it|
|00001ec0| 20 6d 69 67 68 74 20 62 | 65 20 62 65 74 74 65 72 | might b|e better|
|00001ed0| 20 74 6f 20 68 61 76 65 | 0a 58 20 20 73 6f 6d 65 | to have|.X some|
|00001ee0| 74 68 69 6e 67 20 72 75 | 6e 6e 69 6e 67 20 61 73 |thing ru|nning as|
|00001ef0| 20 72 6f 6f 74 20 74 68 | 61 74 20 73 75 27 73 20 | root th|at su's |
|00001f00| 74 6f 20 65 61 63 68 20 | 75 73 65 72 6e 61 6d 65 |to each |username|
|00001f10| 20 69 6e 20 74 75 72 6e | 20 61 6e 64 0a 58 20 20 | in turn| and.X |
|00001f20| 67 65 74 73 20 74 68 65 | 20 70 61 74 68 20 74 68 |gets the| path th|
|00001f30| 61 74 20 77 61 79 2e 2e | 2e 3a 2d 29 0a 58 0a 58 |at way..|.:-).X.X|
|00001f40| 2d 20 54 68 65 20 6b 75 | 61 6e 67 20 64 65 73 63 |- The ku|ang desc|
|00001f50| 72 69 62 65 64 20 69 6e | 20 42 61 6c 64 77 69 6e |ribed in| Baldwin|
|00001f60| 27 73 20 64 69 73 73 65 | 72 74 61 74 69 6f 6e 20 |'s disse|rtation |
|00001f70| 69 73 20 73 6f 6d 65 77 | 68 61 74 20 64 69 66 66 |is somew|hat diff|
|00001f80| 65 72 65 6e 74 0a 58 20 | 20 69 6e 20 6e 61 74 75 |erent.X | in natu|
|00001f90| 72 65 20 66 72 6f 6d 20 | 74 68 69 73 20 6f 6e 65 |re from |this one|
|00001fa0| 2e 20 20 54 68 65 20 6f | 72 69 67 69 6e 61 6c 20 |. The o|riginal |
|00001fb0| 63 6f 6d 70 75 74 65 73 | 20 61 20 50 72 69 76 69 |computes| a Privi|
|00001fc0| 6c 65 67 65 20 41 63 63 | 65 73 73 0a 58 20 20 54 |lege Acc|ess.X T|
|00001fd0| 61 62 6c 65 20 28 50 41 | 54 29 20 77 68 69 63 68 |able (PA|T) which|
|00001fe0| 20 64 65 73 63 72 69 62 | 65 73 20 66 6f 72 20 65 | describ|es for e|
|00001ff0| 61 63 68 20 75 69 64 20 | 61 6e 64 20 67 69 64 20 |ach uid |and gid |
|00002000| 77 68 69 63 68 20 75 69 | 64 73 20 68 61 76 65 0a |which ui|ds have.|
|00002010| 58 20 20 61 63 63 65 73 | 73 20 74 6f 20 74 68 61 |X acces|s to tha|
|00002020| 74 20 75 69 64 2e 20 20 | 54 6f 20 61 73 73 65 73 |t uid. |To asses|
|00002030| 73 20 73 65 63 75 72 69 | 74 79 2c 20 77 65 20 63 |s securi|ty, we c|
|00002040| 6f 6d 70 61 72 65 20 74 | 68 69 73 20 61 67 61 69 |ompare t|his agai|
|00002050| 6e 73 74 20 74 68 65 0a | 58 20 20 73 65 63 75 72 |nst the.|X secur|
|00002060| 69 74 79 20 70 6f 6c 69 | 63 79 20 66 6f 72 20 74 |ity poli|cy for t|
|00002070| 68 65 20 73 69 74 65 2c | 20 77 68 69 63 68 20 73 |he site,| which s|
|00002080| 69 6d 69 6c 61 72 6c 79 | 20 64 65 73 63 72 69 62 |imilarly| describ|
|00002090| 65 73 20 77 68 69 63 68 | 20 75 69 64 27 73 0a 58 |es which| uid's.X|
|000020a0| 20 20 61 72 65 20 73 75 | 70 70 6f 73 65 64 20 74 | are su|pposed t|
|000020b0| 6f 20 68 61 76 65 20 61 | 63 63 65 73 73 20 74 6f |o have a|ccess to|
|000020c0| 20 65 61 63 68 20 75 69 | 64 20 61 6e 64 20 67 69 | each ui|d and gi|
|000020d0| 64 2e 20 20 41 20 73 61 | 6d 70 6c 65 20 53 50 20 |d. A sa|mple SP |
|000020e0| 6d 69 67 68 74 0a 58 20 | 20 62 65 20 74 68 61 74 |might.X | be that|
|000020f0| 20 65 61 63 68 20 75 69 | 64 20 73 68 6f 75 6c 64 | each ui|d should|
|00002100| 20 62 65 20 61 63 63 65 | 73 73 69 62 6c 65 20 6f | be acce|ssible o|
|00002110| 6e 6c 79 20 62 79 20 69 | 74 73 65 6c 66 20 61 6e |nly by i|tself an|
|00002120| 64 20 72 6f 6f 74 2c 20 | 61 6e 64 0a 58 20 20 65 |d root, |and.X e|
|00002130| 61 63 68 20 67 69 64 20 | 73 68 6f 75 6c 64 20 62 |ach gid |should b|
|00002140| 65 20 61 63 63 65 73 73 | 69 62 6c 65 20 6f 6e 6c |e access|ible onl|
|00002150| 79 20 74 6f 20 74 68 65 | 20 6d 65 6d 62 65 72 73 |y to the| members|
|00002160| 20 6f 66 20 74 68 61 74 | 20 67 72 6f 75 70 20 61 | of that| group a|
|00002170| 6e 64 0a 58 20 20 72 6f | 6f 74 2e 20 20 49 66 20 |nd.X ro|ot. If |
|00002180| 74 68 65 20 50 41 54 20 | 6c 69 73 74 65 64 20 61 |the PAT |listed a|
|00002190| 64 64 69 74 69 6f 6e 61 | 6c 20 75 69 64 27 73 20 |dditiona|l uid's |
|000021a0| 66 6f 72 20 73 6f 6d 65 | 20 70 72 69 76 2c 20 74 |for some| priv, t|
|000021b0| 68 61 74 20 77 6f 75 6c | 64 0a 58 20 20 63 6f 6e |hat woul|d.X con|
|000021c0| 73 74 69 74 75 74 65 20 | 61 20 76 69 6f 6c 61 74 |stitute |a violat|
|000021d0| 69 6f 6e 20 6f 66 20 74 | 68 65 20 53 65 63 75 72 |ion of t|he Secur|
|000021e0| 69 74 79 20 50 6f 6c 69 | 63 79 20 66 6f 72 20 74 |ity Poli|cy for t|
|000021f0| 68 65 20 73 69 74 65 2e | 0a 58 0a 58 20 20 54 68 |he site.|.X.X Th|
|00002200| 65 20 63 75 72 72 65 6e | 74 20 6b 75 61 6e 67 20 |e curren|t kuang |
|00002210| 69 73 20 64 69 66 66 65 | 72 65 6e 74 2e 20 20 49 |is diffe|rent. I|
|00002220| 74 20 72 65 67 69 73 74 | 65 72 73 20 53 75 63 63 |t regist|ers Succ|
|00002230| 65 73 73 20 28 61 20 70 | 72 6f 62 6c 65 6d 20 77 |ess (a p|roblem w|
|00002240| 61 73 0a 58 20 20 66 6f | 75 6e 64 29 20 69 66 20 |as.X fo|und) if |
|00002250| 69 74 20 64 65 74 65 72 | 6d 69 6e 65 73 20 74 68 |it deter|mines th|
|00002260| 61 74 20 73 6f 6d 65 20 | 75 69 64 20 69 6e 20 74 |at some |uid in t|
|00002270| 68 65 20 75 69 64 73 2e | 6b 6e 6f 77 6e 20 6c 69 |he uids.|known li|
|00002280| 73 74 20 28 2d 31 2c 0a | 58 20 20 22 6f 74 68 65 |st (-1,.|X "othe|
|00002290| 72 22 20 62 79 20 64 65 | 66 61 75 6c 74 29 20 63 |r" by de|fault) c|
|000022a0| 61 6e 20 61 63 63 65 73 | 73 20 74 68 65 20 74 61 |an acces|s the ta|
|000022b0| 72 67 65 74 20 70 72 69 | 76 69 6c 65 67 65 2e 20 |rget pri|vilege. |
|000022c0| 20 49 74 20 6d 61 79 20 | 66 69 6e 64 0a 58 20 20 | It may |find.X |
|000022d0| 61 6c 6f 6e 67 20 74 68 | 65 20 77 61 79 20 74 68 |along th|e way th|
|000022e0| 61 74 20 65 78 74 72 61 | 20 75 69 64 73 20 63 61 |at extra| uids ca|
|000022f0| 6e 20 61 63 63 65 73 73 | 20 73 6f 6d 65 20 75 69 |n access| some ui|
|00002300| 64 2c 20 62 75 74 20 74 | 68 65 73 65 20 61 72 65 |d, but t|hese are|
|00002310| 6e 27 74 0a 58 20 20 72 | 65 70 6f 72 74 65 64 20 |n't.X r|eported |
|00002320| 61 73 20 73 70 65 63 69 | 66 69 63 20 70 72 6f 62 |as speci|fic prob|
|00002330| 6c 65 6d 73 20 75 6e 6c | 65 73 73 20 74 68 65 79 |lems unl|ess they|
|00002340| 20 61 72 65 20 61 64 64 | 65 64 20 74 6f 20 74 68 | are add|ed to th|
|00002350| 65 0a 58 20 20 75 69 64 | 73 2e 6b 6e 6f 77 6e 20 |e.X uid|s.known |
|00002360| 6c 69 73 74 2e 20 0a 58 | 0a 58 20 20 57 65 20 63 |list. .X|.X We c|
|00002370| 6f 75 6c 64 20 64 6f 20 | 73 6f 6d 65 74 68 69 6e |ould do |somethin|
|00002380| 67 20 73 69 6d 69 6c 61 | 72 20 74 6f 20 74 68 65 |g simila|r to the|
|00002390| 20 6b 75 61 6e 67 20 64 | 65 73 63 72 69 62 65 64 | kuang d|escribed|
|000023a0| 20 69 6e 20 74 68 65 20 | 70 61 70 65 72 20 62 79 | in the |paper by|
|000023b0| 0a 58 20 20 73 65 74 74 | 69 6e 67 20 75 69 64 73 |.X sett|ing uids|
|000023c0| 2e 6b 6e 6f 77 6e 20 74 | 6f 20 62 65 20 61 6c 6c |.known t|o be all|
|000023d0| 20 74 68 65 20 75 69 64 | 73 20 74 68 61 74 20 61 | the uid|s that a|
|000023e0| 72 65 6e 27 74 20 69 6e | 20 74 68 65 20 73 65 63 |ren't in| the sec|
|000023f0| 75 72 69 74 79 0a 58 20 | 20 70 6f 6c 69 63 79 20 |urity.X | policy |
|00002400| 74 61 62 6c 65 20 66 6f | 72 20 74 68 65 20 74 61 |table fo|r the ta|
|00002410| 72 67 65 74 20 75 69 64 | 2c 20 61 6e 64 20 72 75 |rget uid|, and ru|
|00002420| 6e 6e 69 6e 67 20 6b 75 | 61 6e 67 20 61 67 61 69 |nning ku|ang agai|
|00002430| 6e 73 74 20 74 68 65 0a | 58 20 20 74 61 72 67 65 |nst the.|X targe|
|00002440| 74 2e 20 20 54 68 69 73 | 20 77 6f 75 6c 64 20 72 |t. This| would r|
|00002450| 65 70 6f 72 74 20 73 75 | 63 63 65 73 73 20 66 6f |eport su|ccess fo|
|00002460| 72 20 65 61 63 68 20 75 | 69 64 20 74 68 61 74 20 |r each u|id that |
|00002470| 63 6f 75 6c 64 20 61 63 | 63 65 73 73 0a 58 20 20 |could ac|cess.X |
|00002480| 74 68 65 20 74 61 72 67 | 65 74 2e 20 20 59 6f 75 |the targ|et. You|
|00002490| 20 63 6f 75 6c 64 20 64 | 6f 20 73 69 6d 69 6c 61 | could d|o simila|
|000024a0| 72 20 74 68 69 6e 67 73 | 20 77 69 74 68 20 67 72 |r things| with gr|
|000024b0| 6f 75 70 73 20 2d 20 75 | 69 64 73 2e 6b 6e 6f 77 |oups - u|ids.know|
|000024c0| 6e 0a 58 20 20 77 6f 75 | 6c 64 20 62 65 20 61 6c |n.X wou|ld be al|
|000024d0| 6c 20 74 68 65 20 75 69 | 64 73 20 74 68 61 74 20 |l the ui|ds that |
|000024e0| 61 72 65 6e 27 74 20 6d | 65 6d 62 65 72 73 20 6f |aren't m|embers o|
|000024f0| 66 20 74 68 65 20 67 72 | 6f 75 70 2e 2e 2e 0a 58 |f the gr|oup....X|
|00002500| 0a 58 20 20 41 6c 74 65 | 72 6e 61 74 65 6c 79 2c |.X Alte|rnately,|
|00002510| 20 77 65 20 63 6f 75 6c | 64 20 73 69 6d 70 6c 79 | we coul|d simply|
|00002520| 20 68 61 76 65 20 6b 75 | 61 6e 67 20 72 65 63 6f | have ku|ang reco|
|00002530| 72 64 20 74 68 65 20 6c | 69 73 74 20 6f 66 20 75 |rd the l|ist of u|
|00002540| 69 64 73 20 74 68 61 74 | 0a 58 20 20 63 61 6e 20 |ids that|.X can |
|00002550| 61 63 63 65 73 73 20 74 | 68 65 20 74 61 72 67 65 |access t|he targe|
|00002560| 74 20 70 72 69 76 20 61 | 6e 64 20 70 72 69 6e 74 |t priv a|nd print|
|00002570| 20 74 68 65 20 6c 69 73 | 74 20 77 68 65 6e 20 69 | the lis|t when i|
|00002580| 74 73 20 64 6f 6e 65 2e | 20 20 54 68 61 74 0a 58 |ts done.| That.X|
|00002590| 20 20 77 61 79 20 79 6f | 75 20 63 6f 75 6c 64 20 | way yo|u could |
|000025a0| 69 74 65 72 61 74 65 20 | 6b 75 61 6e 67 20 61 67 |iterate |kuang ag|
|000025b0| 61 69 6e 73 74 20 61 6c | 6c 20 75 69 64 73 20 61 |ainst al|l uids a|
|000025c0| 6e 64 20 67 69 64 73 20 | 61 6e 64 20 63 6f 6d 70 |nd gids |and comp|
|000025d0| 61 72 65 0a 58 20 20 74 | 68 65 20 72 65 73 75 6c |are.X t|he resul|
|000025e0| 74 69 6e 67 20 50 41 54 | 20 61 67 61 69 6e 73 74 |ting PAT| against|
|000025f0| 20 79 6f 75 72 20 73 65 | 63 75 72 69 74 79 20 70 | your se|curity p|
|00002600| 6f 6c 69 63 79 20 61 6e | 64 20 72 65 63 6f 72 64 |olicy an|d record|
|00002610| 20 74 68 65 0a 58 20 20 | 64 69 66 66 65 72 65 6e | the.X |differen|
|00002620| 63 65 73 2e 20 20 59 6f | 75 27 64 20 70 72 6f 62 |ces. Yo|u'd prob|
|00002630| 61 62 6c 79 20 77 61 6e | 74 20 74 6f 20 72 65 63 |ably wan|t to rec|
|00002640| 6f 72 64 20 74 68 65 20 | 70 6c 61 6e 20 66 6f 72 |ord the |plan for|
|00002650| 20 65 61 63 68 20 75 69 | 64 0a 58 20 20 72 65 70 | each ui|d.X rep|
|00002660| 6f 72 74 65 64 20 61 6c | 73 6f 2e 0a 58 0a 58 20 |orted al|so..X.X |
|00002670| 20 4f 6e 20 6f 75 72 20 | 73 79 73 74 65 6d 20 74 | On our |system t|
|00002680| 68 69 73 20 77 6f 75 6c | 64 20 6d 65 61 6e 20 72 |his woul|d mean r|
|00002690| 75 6e 6e 69 6e 67 20 6b | 75 61 6e 67 20 72 6f 75 |unning k|uang rou|
|000026a0| 67 68 6c 79 20 32 35 30 | 30 0a 58 20 20 74 69 6d |ghly 250|0.X tim|
|000026b0| 65 73 20 74 6f 20 63 68 | 65 63 6b 20 31 20 68 6f |es to ch|eck 1 ho|
|000026c0| 73 74 2c 20 61 6e 64 20 | 77 65 20 68 61 76 65 20 |st, and |we have |
|000026d0| 61 62 6f 75 74 20 33 30 | 30 20 68 6f 73 74 73 2e |about 30|0 hosts.|
|000026e0| 2e 2e 75 72 66 2e 2e 2e | 61 73 73 75 6d 69 6e 67 |..urf...|assuming|
|000026f0| 0a 58 20 20 74 68 61 74 | 20 65 61 63 68 20 6b 75 |.X that| each ku|
|00002700| 61 6e 67 20 69 6e 76 6f | 63 61 74 69 6f 6e 20 68 |ang invo|cation h|
|00002710| 61 73 20 74 6f 20 63 68 | 65 63 6b 20 35 30 20 70 |as to ch|eck 50 p|
|00002720| 6c 61 6e 73 2c 20 74 68 | 61 74 27 73 20 61 20 74 |lans, th|at's a t|
|00002730| 6f 74 61 6c 20 6f 66 0a | 58 20 20 31 32 35 2c 30 |otal of.|X 125,0|
|00002740| 30 30 20 70 6c 61 6e 73 | 20 70 65 72 20 68 6f 73 |00 plans| per hos|
|00002750| 74 2c 20 6f 72 20 61 62 | 6f 75 74 20 61 6e 20 68 |t, or ab|out an h|
|00002760| 6f 75 72 20 6f 66 20 72 | 65 61 6c 20 74 69 6d 65 |our of r|eal time|
|00002770| 2e 2e 2e 6e 6f 74 20 61 | 73 20 62 61 64 0a 58 20 |...not a|s bad.X |
|00002780| 20 61 73 20 69 74 20 63 | 6f 75 6c 64 20 62 65 2c | as it c|ould be,|
|00002790| 20 74 68 6f 75 67 68 2e | 0a 58 0a 58 2d 20 49 74 | though.|.X.X- It|
|000027a0| 20 77 6f 75 6c 64 20 62 | 65 20 6e 69 63 65 20 74 | would b|e nice t|
|000027b0| 6f 20 61 64 64 20 74 6f | 20 74 68 65 20 6c 69 73 |o add to| the lis|
|000027c0| 74 20 6f 66 20 72 75 6c | 65 73 2e 20 20 49 74 20 |t of rul|es. It |
|000027d0| 77 6f 75 6c 64 20 62 65 | 20 65 73 70 65 63 69 61 |would be| especia|
|000027e0| 6c 6c 79 0a 58 20 20 6e | 69 63 65 20 74 6f 20 65 |lly.X n|ice to e|
|000027f0| 78 74 72 61 63 74 20 74 | 68 65 20 72 75 6c 65 73 |xtract t|he rules|
|00002800| 20 66 72 6f 6d 20 74 68 | 65 20 63 6f 64 65 20 73 | from th|e code s|
|00002810| 6f 20 74 68 61 74 20 77 | 65 20 63 61 6e 20 63 72 |o that w|e can cr|
|00002820| 65 61 74 65 20 73 69 74 | 65 0a 58 20 20 73 70 65 |eate sit|e.X spe|
|00002830| 63 69 66 69 63 20 72 75 | 6c 65 20 66 69 6c 65 73 |cific ru|le files|
|00002840| 20 28 66 6f 72 20 65 78 | 61 6d 70 6c 65 2c 20 77 | (for ex|ample, w|
|00002850| 65 20 75 73 65 20 58 31 | 31 72 34 20 68 65 72 65 |e use X1|1r4 here|
|00002860| 2c 20 61 6e 64 20 6d 61 | 6e 79 20 75 73 65 72 73 |, and ma|ny users|
|00002870| 0a 58 20 20 68 61 76 65 | 20 61 20 2e 58 69 6e 69 |.X have| a .Xini|
|00002880| 74 72 63 20 74 68 61 74 | 20 63 6f 6e 74 61 69 6e |trc that| contain|
|00002890| 73 20 73 68 65 6c 6c 20 | 63 6f 6d 6d 61 6e 64 73 |s shell |commands|
|000028a0| 20 74 68 61 74 20 67 65 | 74 20 65 78 65 63 75 74 | that ge|t execut|
|000028b0| 65 64 20 77 68 65 6e 0a | 58 20 20 74 68 65 79 20 |ed when.|X they |
|000028c0| 6c 6f 67 69 6e 2e 29 0a | 58 0a 58 20 20 45 61 73 |login.).|X.X Eas|
|000028d0| 69 65 73 74 20 77 61 79 | 20 74 6f 20 64 6f 20 74 |iest way| to do t|
|000028e0| 68 69 73 20 77 6f 75 6c | 64 20 62 65 20 74 6f 20 |his woul|d be to |
|000028f0| 65 78 74 72 61 63 74 20 | 74 68 65 20 72 75 6c 65 |extract |the rule|
|00002900| 73 20 61 73 20 50 65 72 | 6c 20 63 6f 64 65 20 73 |s as Per|l code s|
|00002910| 6f 0a 58 20 20 77 65 20 | 63 61 6e 20 74 61 6b 65 |o.X we |can take|
|00002920| 20 61 64 76 61 6e 74 61 | 67 65 20 6f 66 20 63 6f | advanta|ge of co|
|00002930| 6e 64 69 74 69 6f 6e 61 | 6c 73 20 61 6e 64 20 73 |nditiona|ls and s|
|00002940| 6f 20 6f 6e 2c 20 61 6e | 64 20 69 6e 63 6c 75 64 |o on, an|d includ|
|00002950| 65 20 74 68 65 6d 0a 58 | 20 20 77 69 74 68 69 6e |e them.X| within|
|00002960| 20 74 68 65 20 62 6f 64 | 79 20 6f 66 20 6b 75 61 | the bod|y of kua|
|00002970| 6e 67 20 73 6f 6d 65 68 | 6f 77 2e 20 20 41 20 73 |ng someh|ow. A s|
|00002980| 61 6d 70 6c 65 20 72 75 | 6c 65 20 69 6e 20 70 65 |ample ru|le in pe|
|00002990| 72 6c 3a 0a 58 0a 58 09 | 69 66 20 28 26 73 68 65 |rl:.X.X.|if (&she|
|000029a0| 6c 6c 28 24 75 69 64 29 | 20 65 71 20 22 2f 62 69 |ll($uid)| eq "/bi|
|000029b0| 6e 2f 63 73 68 22 29 20 | 7b 0a 58 09 20 20 20 20 |n/csh") |{.X. |
|000029c0| 26 61 64 64 74 6f 28 22 | 66 69 6c 65 73 22 2c 20 |&addto("|files", |
|000029d0| 26 68 6f 6d 65 28 24 75 | 69 64 29 2e 22 2f 2e 6c |&home($u|id)."/.l|
|000029e0| 6f 67 69 6e 22 2c 20 0a | 58 09 09 09 22 72 65 70 |ogin", .|X..."rep|
|000029f0| 6c 61 63 65 20 2e 6c 6f | 67 69 6e 20 24 70 6c 61 |lace .lo|gin $pla|
|00002a00| 6e 22 29 3b 0a 58 09 7d | 0a 58 0a 58 20 20 77 68 |n");.X.}|.X.X wh|
|00002a10| 69 63 68 20 73 69 6d 70 | 6c 79 20 6d 65 61 6e 73 |ich simp|ly means|
|00002a20| 20 22 69 66 20 74 68 65 | 20 75 73 65 72 27 73 20 | "if the| user's |
|00002a30| 73 68 65 6c 6c 20 69 73 | 20 63 73 68 2c 20 74 68 |shell is| csh, th|
|00002a40| 65 6e 20 74 72 79 20 74 | 6f 20 72 65 70 6c 61 63 |en try t|o replac|
|00002a50| 65 0a 58 20 20 68 69 73 | 20 2e 6c 6f 67 69 6e 20 |e.X his| .login |
|00002a60| 66 69 6c 65 2e 22 20 0a | 58 0a 53 48 41 52 5f 45 |file." .|X.SHAR_E|
|00002a70| 4f 46 0a 63 68 6d 6f 64 | 20 30 36 30 30 20 52 45 |OF.chmod| 0600 RE|
|00002a80| 41 44 4d 45 2e 70 65 72 | 6c 20 7c 7c 0a 65 63 68 |ADME.per|l ||.ech|
|00002a90| 6f 20 27 72 65 73 74 6f | 72 65 20 6f 66 20 52 45 |o 'resto|re of RE|
|00002aa0| 41 44 4d 45 2e 70 65 72 | 6c 20 66 61 69 6c 65 64 |ADME.per|l failed|
|00002ab0| 27 0a 57 63 5f 63 3d 22 | 60 77 63 20 2d 63 20 3c |'.Wc_c="|`wc -c <|
|00002ac0| 20 27 52 45 41 44 4d 45 | 2e 70 65 72 6c 27 60 22 | 'README|.perl'`"|
|00002ad0| 0a 74 65 73 74 20 39 37 | 38 32 20 2d 65 71 20 22 |.test 97|82 -eq "|
|00002ae0| 24 57 63 5f 63 22 20 7c | 7c 0a 09 65 63 68 6f 20 |$Wc_c" |||..echo |
|00002af0| 27 52 45 41 44 4d 45 2e | 70 65 72 6c 3a 20 6f 72 |'README.|perl: or|
|00002b00| 69 67 69 6e 61 6c 20 73 | 69 7a 65 20 39 37 38 32 |iginal s|ize 9782|
|00002b10| 2c 20 63 75 72 72 65 6e | 74 20 73 69 7a 65 27 20 |, curren|t size' |
|00002b20| 22 24 57 63 5f 63 22 0a | 66 69 0a 23 20 3d 3d 3d |"$Wc_c".|fi.# ===|
|00002b30| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 20 67 65 74 2d 63 |========|== get-c|
|00002b40| 66 20 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |f ======|========|
|00002b50| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 67 65 74 |.if test| -f 'get|
|00002b60| 2d 63 66 27 20 2d 61 20 | 58 22 24 31 22 20 21 3d |-cf' -a |X"$1" !=|
|00002b70| 20 58 22 2d 63 22 3b 20 | 74 68 65 6e 0a 09 65 63 | X"-c"; |then..ec|
|00002b80| 68 6f 20 27 78 20 2d 20 | 73 6b 69 70 70 69 6e 67 |ho 'x - |skipping|
|00002b90| 20 67 65 74 2d 63 66 20 | 28 46 69 6c 65 20 61 6c | get-cf |(File al|
|00002ba0| 72 65 61 64 79 20 65 78 | 69 73 74 73 29 27 0a 65 |ready ex|ists)'.e|
|00002bb0| 6c 73 65 0a 65 63 68 6f | 20 27 78 20 2d 20 65 78 |lse.echo| 'x - ex|
|00002bc0| 74 72 61 63 74 69 6e 67 | 20 67 65 74 2d 63 66 20 |tracting| get-cf |
|00002bd0| 28 54 65 78 74 29 27 0a | 73 65 64 20 27 73 2f 5e |(Text)'.|sed 's/^|
|00002be0| 58 2f 2f 27 20 3c 3c 20 | 27 53 48 41 52 5f 45 4f |X//' << |'SHAR_EO|
|00002bf0| 46 27 20 3e 20 27 67 65 | 74 2d 63 66 27 20 26 26 |F' > 'ge|t-cf' &&|
|00002c00| 0a 58 23 21 20 2f 75 73 | 72 2f 6c 6f 63 61 6c 2f |.X#! /us|r/local/|
|00002c10| 62 69 6e 2f 70 65 72 6c | 0a 58 0a 58 40 64 6f 74 |bin/perl|.X.X@dot|
|00002c20| 5f 66 69 6c 65 73 20 3d | 20 28 0a 58 20 20 20 20 |_files =| (.X |
|00002c30| 22 2e 6c 6f 67 69 6e 22 | 2c 20 22 2e 6c 6f 67 6f |".login"|, ".logo|
|00002c40| 75 74 22 2c 20 22 2e 63 | 73 68 72 63 22 2c 09 09 |ut", ".c|shrc",..|
|00002c50| 09 23 20 63 73 68 2c 20 | 63 73 68 65 20 6f 72 20 |.# csh, |cshe or |
|00002c60| 74 63 73 68 0a 58 20 20 | 20 20 22 2e 70 72 6f 66 |tcsh.X | ".prof|
|00002c70| 69 6c 65 22 2c 09 09 09 | 09 09 09 23 20 6b 73 68 |ile",...|...# ksh|
|00002c80| 2c 20 73 68 0a 58 20 20 | 20 20 22 2e 65 6e 76 22 |, sh.X | ".env"|
|00002c90| 2c 09 09 09 09 09 09 23 | 20 6b 73 68 0a 58 20 20 |,......#| ksh.X |
|00002ca0| 20 20 22 2e 61 6c 69 61 | 73 22 2c 20 22 2e 61 6c | ".alia|s", ".al|
|00002cb0| 69 61 73 65 73 22 2c 09 | 09 09 09 23 20 63 6f 6d |iases",.|...# com|
|00002cc0| 6d 6f 6e 20 66 6f 72 20 | 61 6c 6c 20 73 68 65 6c |mon for |all shel|
|00002cd0| 6c 73 0a 58 20 20 20 20 | 22 75 73 65 72 2e 70 73 |ls.X |"user.ps|
|00002ce0| 22 2c 20 22 2e 75 73 65 | 72 2e 70 73 22 2c 20 22 |", ".use|r.ps", "|
|00002cf0| 74 6f 6f 6c 73 2e 70 73 | 22 2c 20 22 2e 74 6f 6f |tools.ps|", ".too|
|00002d00| 6c 73 2e 70 73 22 2c 0a | 58 09 22 73 74 61 72 74 |ls.ps",.|X."start|
|00002d10| 75 70 2e 70 73 22 2c 20 | 22 2e 73 74 61 72 74 75 |up.ps", |".startu|
|00002d20| 70 2e 70 73 22 2c 09 09 | 09 23 20 4e 65 57 53 0a |p.ps",..|.# NeWS.|
|00002d30| 58 20 20 20 20 22 2e 6d | 67 72 63 22 2c 09 09 09 |X ".m|grc",...|
|00002d40| 09 09 09 23 20 4d 47 52 | 0a 58 20 20 20 20 22 2e |...# MGR|.X ".|
|00002d50| 58 31 31 69 6e 69 74 22 | 2c 20 22 2e 61 77 6d 72 |X11init"|, ".awmr|
|00002d60| 63 22 2c 20 22 2e 74 77 | 6d 72 63 22 2c 20 22 2e |c", ".tw|mrc", ".|
|00002d70| 78 69 6e 69 74 72 63 22 | 2c 09 09 23 20 58 31 31 |xinitrc"|,..# X11|
|00002d80| 0a 58 20 20 20 20 22 2e | 65 6d 61 63 73 22 09 09 |.X ".|emacs"..|
|00002d90| 09 09 09 09 23 20 65 6d | 61 63 73 0a 58 29 3b 0a |....# em|acs.X);.|
|00002da0| 58 0a 58 25 73 65 65 6e | 20 3d 20 7b 7d 3b 0a 58 |X.X%seen| = {};.X|
|00002db0| 0a 58 6f 70 65 6e 28 48 | 4f 53 54 2c 20 22 2f 62 |.Xopen(H|OST, "/b|
|00002dc0| 69 6e 2f 68 6f 73 74 6e | 61 6d 65 20 7c 22 29 20 |in/hostn|ame |") |
|00002dd0| 7c 7c 20 64 69 65 20 22 | 63 61 6e 27 74 20 67 65 ||| die "|can't ge|
|00002de0| 74 20 74 68 65 20 68 6f | 73 74 6e 61 6d 65 22 3b |t the ho|stname";|
|00002df0| 0a 58 63 68 6f 70 28 24 | 68 6f 73 74 6e 61 6d 65 |.Xchop($|hostname|
|00002e00| 3d 3c 48 4f 53 54 3e 29 | 3b 0a 58 63 6c 6f 73 65 |=<HOST>)|;.Xclose|
|00002e10| 28 48 4f 53 54 29 3b 0a | 58 0a 58 75 73 65 72 5f |(HOST);.|X.Xuser_|
|00002e20| 6c 6f 6f 70 3a 0a 58 20 | 20 20 20 66 6f 72 20 28 |loop:.X | for (|
|00002e30| 28 24 6e 61 6d 65 2c 24 | 70 61 73 73 77 64 2c 24 |($name,$|passwd,$|
|00002e40| 75 69 64 2c 24 67 69 64 | 2c 24 71 75 6f 74 61 2c |uid,$gid|,$quota,|
|00002e50| 24 63 6f 6d 6d 65 6e 74 | 2c 24 67 63 6f 73 2c 24 |$comment|,$gcos,$|
|00002e60| 64 69 72 2c 24 73 68 65 | 6c 6c 29 20 3d 20 67 65 |dir,$she|ll) = ge|
|00002e70| 74 70 77 65 6e 74 28 29 | 3b 0a 58 20 20 20 20 20 |tpwent()|;.X |
|00002e80| 20 20 20 20 24 6e 61 6d | 65 20 6e 65 20 22 22 3b | $nam|e ne "";|
|00002e90| 0a 58 20 20 20 20 20 20 | 20 20 20 28 24 6e 61 6d |.X | ($nam|
|00002ea0| 65 2c 24 70 61 73 73 77 | 64 2c 24 75 69 64 2c 24 |e,$passw|d,$uid,$|
|00002eb0| 67 69 64 2c 24 71 75 6f | 74 61 2c 24 63 6f 6d 6d |gid,$quo|ta,$comm|
|00002ec0| 65 6e 74 2c 24 67 63 6f | 73 2c 24 64 69 72 2c 24 |ent,$gco|s,$dir,$|
|00002ed0| 73 68 65 6c 6c 29 20 3d | 20 67 65 74 70 77 65 6e |shell) =| getpwen|
|00002ee0| 74 28 29 29 20 7b 0a 58 | 0a 58 09 23 0a 58 09 23 |t()) {.X|.X.#.X.#|
|00002ef0| 20 49 66 20 74 68 65 20 | 75 73 65 72 20 68 61 73 | If the |user has|
|00002f00| 20 61 20 68 6f 6d 65 20 | 64 69 72 65 63 74 6f 72 | a home |director|
|00002f10| 79 20 6f 6e 20 74 68 69 | 73 20 73 65 72 76 65 72 |y on thi|s server|
|00002f20| 2c 20 67 65 74 20 74 68 | 65 20 69 6e 66 6f 20 0a |, get th|e info .|
|00002f30| 58 09 23 20 61 62 6f 75 | 74 20 74 68 65 20 64 69 |X.# abou|t the di|
|00002f40| 72 65 63 74 6f 72 79 2c | 20 68 69 73 20 43 46 27 |rectory,| his CF'|
|00002f50| 73 20 61 6e 64 20 73 6f | 20 6f 6e 2e 0a 58 09 23 |s and so| on..X.#|
|00002f60| 0a 58 09 69 66 20 28 24 | 64 69 72 20 3d 7e 20 6d |.X.if ($|dir =~ m|
|00002f70| 2c 5e 2f 6e 2f 24 68 6f | 73 74 6e 61 6d 65 2f 2c |,^/n/$ho|stname/,|
|00002f80| 29 20 7b 0a 58 09 20 20 | 20 20 69 66 20 28 21 20 |) {.X. | if (! |
|00002f90| 2d 64 20 24 64 69 72 29 | 20 7b 0a 58 09 09 70 72 |-d $dir)| {.X..pr|
|00002fa0| 69 6e 74 66 28 73 74 64 | 65 72 72 20 22 68 6f 6d |intf(std|err "hom|
|00002fb0| 65 20 64 69 72 65 63 74 | 6f 72 79 20 27 25 73 27 |e direct|ory '%s'|
|00002fc0| 20 66 6f 72 20 75 73 65 | 72 20 27 25 73 27 20 64 | for use|r '%s' d|
|00002fd0| 6f 65 73 6e 27 74 20 65 | 78 69 73 74 2e 5c 6e 22 |oesn't e|xist.\n"|
|00002fe0| 2c 0a 58 09 09 09 24 64 | 69 72 2c 0a 58 09 09 09 |,.X...$d|ir,.X...|
|00002ff0| 24 6e 61 6d 65 29 3b 0a | 58 09 09 6e 65 78 74 20 |$name);.|X..next |
|00003000| 75 73 65 72 5f 6c 6f 6f | 70 3b 0a 58 09 20 20 20 |user_loo|p;.X. |
|00003010| 20 7d 0a 58 0a 58 09 20 | 20 20 20 28 24 64 65 76 | }.X.X. | ($dev|
|00003020| 2c 24 69 6e 6f 2c 24 6d | 6f 64 65 2c 24 6e 6c 69 |,$ino,$m|ode,$nli|
|00003030| 6e 6b 2c 24 75 69 64 2c | 24 67 69 64 2c 24 72 64 |nk,$uid,|$gid,$rd|
|00003040| 65 76 2c 24 73 69 7a 65 | 2c 0a 58 20 20 20 20 20 |ev,$size|,.X |
|00003050| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 24 | | $|
|00003060| 61 74 69 6d 65 2c 24 6d | 74 69 6d 65 2c 24 63 74 |atime,$m|time,$ct|
|00003070| 69 6d 65 2c 24 62 6c 6b | 73 69 7a 65 2c 24 62 6c |ime,$blk|size,$bl|
|00003080| 6f 63 6b 73 29 0a 58 20 | 20 20 20 20 20 20 20 20 |ocks).X | |
|00003090| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 3d | | =|
|000030a0| 20 73 74 61 74 28 5f 29 | 3b 0a 58 09 20 20 20 20 | stat(_)|;.X. |
|000030b0| 24 6d 6f 64 65 20 3d 20 | 24 6d 6f 64 65 20 26 20 |$mode = |$mode & |
|000030c0| 30 37 37 37 37 3b 0a 58 | 0a 58 09 20 20 20 20 26 |07777;.X|.X. &|
|000030d0| 73 70 69 74 5f 69 74 5f | 6f 75 74 28 22 64 22 2c |spit_it_|out("d",|
|000030e0| 20 24 75 69 64 2c 20 24 | 67 69 64 2c 20 24 6d 6f | $uid, $|gid, $mo|
|000030f0| 64 65 2c 20 24 64 69 72 | 29 3b 0a 58 0a 58 09 20 |de, $dir|);.X.X. |
|00003100| 20 20 20 66 6f 72 65 61 | 63 68 20 24 66 69 6c 65 | forea|ch $file|
|00003110| 20 28 40 64 6f 74 5f 66 | 69 6c 65 73 29 20 7b 0a | (@dot_f|iles) {.|
|00003120| 58 09 09 24 70 61 74 68 | 20 3d 20 22 24 64 69 72 |X..$path| = "$dir|
|00003130| 2f 24 66 69 6c 65 22 3b | 0a 58 0a 58 09 09 69 66 |/$file";|.X.X..if|
|00003140| 20 28 2d 66 20 24 70 61 | 74 68 29 20 7b 0a 58 09 | (-f $pa|th) {.X.|
|00003150| 09 20 20 20 20 28 24 64 | 65 76 2c 24 69 6e 6f 2c |. ($d|ev,$ino,|
|00003160| 24 6d 6f 64 65 2c 24 6e | 6c 69 6e 6b 2c 24 75 69 |$mode,$n|link,$ui|
|00003170| 64 2c 24 67 69 64 2c 24 | 72 64 65 76 2c 24 73 69 |d,$gid,$|rdev,$si|
|00003180| 7a 65 2c 0a 58 20 20 20 | 20 20 20 20 20 20 20 20 |ze,.X | |
|00003190| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 24 61 74 | | $at|
|000031a0| 69 6d 65 2c 24 6d 74 69 | 6d 65 2c 24 63 74 69 6d |ime,$mti|me,$ctim|
|000031b0| 65 2c 24 62 6c 6b 73 69 | 7a 65 2c 24 62 6c 6f 63 |e,$blksi|ze,$bloc|
|000031c0| 6b 73 29 0a 58 20 20 20 | 20 20 20 20 20 20 20 20 |ks).X | |
|000031d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000031e0| 20 3d 20 73 74 61 74 28 | 5f 29 3b 0a 58 09 09 20 | = stat(|_);.X.. |
|000031f0| 20 20 20 24 6d 6f 64 65 | 20 3d 20 24 6d 6f 64 65 | $mode| = $mode|
|00003200| 20 26 20 30 37 37 37 37 | 3b 0a 58 0a 58 09 09 20 | & 07777|;.X.X.. |
|00003210| 20 20 20 26 73 70 69 74 | 5f 69 74 5f 6f 75 74 28 | &spit|_it_out(|
|00003220| 22 66 22 2c 20 24 75 69 | 64 2c 20 24 67 69 64 2c |"f", $ui|d, $gid,|
|00003230| 20 24 6d 6f 64 65 2c 20 | 24 64 69 72 29 3b 0a 58 | $mode, |$dir);.X|
|00003240| 09 09 7d 0a 58 09 20 20 | 20 20 7d 0a 58 09 7d 0a |..}.X. | }.X.}.|
|00003250| 58 20 20 20 20 7d 0a 58 | 0a 58 0a 58 0a 58 0a 58 |X }.X|.X.X.X.X|
|00003260| 73 75 62 20 73 70 69 74 | 5f 69 74 5f 6f 75 74 20 |sub spit|_it_out |
|00003270| 7b 0a 58 20 20 20 20 6c | 6f 63 61 6c 28 24 74 79 |{.X l|ocal($ty|
|00003280| 70 65 2c 20 24 75 69 64 | 2c 20 24 67 69 64 2c 20 |pe, $uid|, $gid, |
|00003290| 24 6d 6f 64 65 2c 20 24 | 6e 61 6d 65 29 20 3d 20 |$mode, $|name) = |
|000032a0| 40 5f 3b 0a 58 0a 58 20 | 20 20 20 69 66 20 28 64 |@_;.X.X | if (d|
|000032b0| 65 66 69 6e 65 64 28 24 | 73 65 65 6e 7b 24 6e 61 |efined($|seen{$na|
|000032c0| 6d 65 7d 29 29 20 7b 0a | 58 09 72 65 74 75 72 6e |me})) {.|X.return|
|000032d0| 3b 0a 58 20 20 20 20 7d | 0a 58 0a 58 20 20 20 20 |;.X }|.X.X |
|000032e0| 70 72 69 6e 74 66 28 22 | 25 73 20 25 64 20 25 64 |printf("|%s %d %d|
|000032f0| 20 30 25 6f 20 25 73 5c | 6e 22 2c 20 24 74 79 70 | 0%o %s\|n", $typ|
|00003300| 65 2c 20 24 75 69 64 2c | 20 24 67 69 64 2c 20 24 |e, $uid,| $gid, $|
|00003310| 6d 6f 64 65 2c 20 24 6e | 61 6d 65 29 3b 0a 58 20 |mode, $n|ame);.X |
|00003320| 20 20 20 24 73 65 65 6e | 7b 24 6e 61 6d 65 7d 20 | $seen|{$name} |
|00003330| 3d 20 31 3b 0a 58 7d 0a | 58 0a 53 48 41 52 5f 45 |= 1;.X}.|X.SHAR_E|
|00003340| 4f 46 0a 63 68 6d 6f 64 | 20 30 37 30 30 20 67 65 |OF.chmod| 0700 ge|
|00003350| 74 2d 63 66 20 7c 7c 0a | 65 63 68 6f 20 27 72 65 |t-cf ||.|echo 're|
|00003360| 73 74 6f 72 65 20 6f 66 | 20 67 65 74 2d 63 66 20 |store of| get-cf |
|00003370| 66 61 69 6c 65 64 27 0a | 57 63 5f 63 3d 22 60 77 |failed'.|Wc_c="`w|
|00003380| 63 20 2d 63 20 3c 20 27 | 67 65 74 2d 63 66 27 60 |c -c < '|get-cf'`|
|00003390| 22 0a 74 65 73 74 20 31 | 37 37 36 20 2d 65 71 20 |".test 1|776 -eq |
|000033a0| 22 24 57 63 5f 63 22 20 | 7c 7c 0a 09 65 63 68 6f |"$Wc_c" |||..echo|
|000033b0| 20 27 67 65 74 2d 63 66 | 3a 20 6f 72 69 67 69 6e | 'get-cf|: origin|
|000033c0| 61 6c 20 73 69 7a 65 20 | 31 37 37 36 2c 20 63 75 |al size |1776, cu|
|000033d0| 72 72 65 6e 74 20 73 69 | 7a 65 27 20 22 24 57 63 |rrent si|ze' "$Wc|
|000033e0| 5f 63 22 0a 66 69 0a 23 | 20 3d 3d 3d 3d 3d 3d 3d |_c".fi.#| =======|
|000033f0| 3d 3d 3d 3d 3d 3d 20 6b | 75 61 6e 67 2e 31 20 3d |====== k|uang.1 =|
|00003400| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 0a 69 66 |========|=====.if|
|00003410| 20 74 65 73 74 20 2d 66 | 20 27 6b 75 61 6e 67 2e | test -f| 'kuang.|
|00003420| 31 27 20 2d 61 20 58 22 | 24 31 22 20 21 3d 20 58 |1' -a X"|$1" != X|
|00003430| 22 2d 63 22 3b 20 74 68 | 65 6e 0a 09 65 63 68 6f |"-c"; th|en..echo|
|00003440| 20 27 78 20 2d 20 73 6b | 69 70 70 69 6e 67 20 6b | 'x - sk|ipping k|
|00003450| 75 61 6e 67 2e 31 20 28 | 46 69 6c 65 20 61 6c 72 |uang.1 (|File alr|
|00003460| 65 61 64 79 20 65 78 69 | 73 74 73 29 27 0a 65 6c |eady exi|sts)'.el|
|00003470| 73 65 0a 65 63 68 6f 20 | 27 78 20 2d 20 65 78 74 |se.echo |'x - ext|
|00003480| 72 61 63 74 69 6e 67 20 | 6b 75 61 6e 67 2e 31 20 |racting |kuang.1 |
|00003490| 28 54 65 78 74 29 27 0a | 73 65 64 20 27 73 2f 5e |(Text)'.|sed 's/^|
|000034a0| 58 2f 2f 27 20 3c 3c 20 | 27 53 48 41 52 5f 45 4f |X//' << |'SHAR_EO|
|000034b0| 46 27 20 3e 20 27 6b 75 | 61 6e 67 2e 31 27 20 26 |F' > 'ku|ang.1' &|
|000034c0| 26 0a 58 2e 54 48 20 4b | 55 41 4e 47 20 31 20 22 |&.X.TH K|UANG 1 "|
|000034d0| 34 20 4f 63 74 6f 62 65 | 72 20 31 39 39 30 22 0a |4 Octobe|r 1990".|
|000034e0| 58 2e 53 48 20 4e 41 4d | 45 0a 58 6b 75 61 6e 67 |X.SH NAM|E.Xkuang|
|000034f0| 20 5c 2d 20 66 69 6e 64 | 20 73 65 63 75 72 69 74 | \- find| securit|
|00003500| 79 20 70 72 6f 62 6c 65 | 6d 73 20 74 68 72 6f 75 |y proble|ms throu|
|00003510| 67 68 20 72 75 6c 65 20 | 62 61 73 65 64 20 61 6e |gh rule |based an|
|00003520| 61 6c 79 73 69 73 0a 58 | 2e 53 48 20 53 59 4e 4f |alysis.X|.SH SYNO|
|00003530| 50 53 49 53 0a 58 2e 42 | 20 6b 75 61 6e 67 0a 58 |PSIS.X.B| kuang.X|
|00003540| 2e 52 42 20 22 5b 5c 7c | 22 20 5c 2d 76 20 20 22 |.RB "[\||" \-v "|
|00003550| 5c 7c 5d 22 0a 58 2e 52 | 42 20 22 5b 5c 7c 22 20 |\|]".X.R|B "[\|" |
|00003560| 5c 2d 64 20 22 5c 7c 5d | 22 0a 58 2e 52 42 20 22 |\-d "\|]|".X.RB "|
|00003570| 5b 5c 7c 22 20 5c 2d 6c | 20 22 5c 7c 5d 22 0a 58 |[\|" \-l| "\|]".X|
|00003580| 2e 52 42 20 22 5b 5c 7c | 22 20 5c 2d 44 20 22 5c |.RB "[\||" \-D "\|
|00003590| 7c 5d 22 0a 58 2e 52 42 | 20 22 5b 5c 7c 22 20 5c ||]".X.RB| "[\|" \|
|000035a0| 2d 66 20 66 69 6c 65 64 | 61 74 61 20 22 5c 7c 5d |-f filed|ata "\|]|
|000035b0| 22 0a 58 2e 52 42 20 22 | 5b 5c 7c 22 20 0a 58 2e |".X.RB "|[\|" .X.|
|000035c0| 49 52 20 75 2e 75 73 65 | 72 6e 61 6d 65 20 22 5c |IR u.use|rname "\|
|000035d0| 7c 5d 22 0a 58 2e 62 72 | 0a 58 2e 42 20 6b 75 61 ||]".X.br|.X.B kua|
|000035e0| 6e 67 0a 58 2e 52 42 20 | 22 5b 5c 7c 22 20 5c 2d |ng.X.RB |"[\|" \-|
|000035f0| 76 20 20 22 5c 7c 5d 22 | 0a 58 2e 52 42 20 22 5b |v "\|]"|.X.RB "[|
|00003600| 5c 7c 22 20 5c 2d 64 20 | 22 5c 7c 5d 22 0a 58 2e |\|" \-d |"\|]".X.|
|00003610| 52 42 20 22 5b 5c 7c 22 | 20 5c 2d 6c 20 22 5c 7c |RB "[\|"| \-l "\||
|00003620| 5d 22 0a 58 2e 52 42 20 | 22 5b 5c 7c 22 20 5c 2d |]".X.RB |"[\|" \-|
|00003630| 44 20 22 5c 7c 5d 22 0a | 58 2e 52 42 20 22 5b 5c |D "\|]".|X.RB "[\|
|00003640| 7c 22 20 5c 2d 66 20 66 | 69 6c 65 64 61 74 61 20 ||" \-f f|iledata |
|00003650| 22 5c 7c 5d 22 0a 58 2e | 52 42 20 22 5b 5c 7c 22 |"\|]".X.|RB "[\|"|
|00003660| 20 0a 58 2e 49 52 20 67 | 2e 67 72 6f 75 70 6e 61 | .X.IR g|.groupna|
|00003670| 6d 65 20 22 5c 7c 5d 22 | 0a 58 2e 62 72 0a 58 2e |me "\|]"|.X.br.X.|
|00003680| 53 48 20 44 45 53 43 52 | 49 50 54 49 4f 4e 0a 58 |SH DESCR|IPTION.X|
|00003690| 2e 4c 50 0a 58 2e 42 20 | 6b 75 61 6e 67 0a 58 75 |.LP.X.B |kuang.Xu|
|000036a0| 73 65 73 20 72 75 6c 65 | 20 62 61 73 65 64 20 61 |ses rule| based a|
|000036b0| 6e 61 6c 79 73 69 73 20 | 74 6f 20 65 78 61 6d 69 |nalysis |to exami|
|000036c0| 6e 65 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 73 |ne the c|urrent s|
|000036d0| 65 63 75 72 69 74 79 20 | 63 6f 6e 66 69 67 75 72 |ecurity |configur|
|000036e0| 61 74 69 6f 6e 0a 58 6f | 66 20 61 20 73 69 74 65 |ation.Xo|f a site|
|000036f0| 20 61 6e 64 20 64 65 74 | 65 72 6d 69 6e 65 20 77 | and det|ermine w|
|00003700| 68 65 74 68 65 72 20 63 | 65 72 74 61 69 6e 20 73 |hether c|ertain s|
|00003710| 65 63 75 72 69 74 79 20 | 70 72 6f 62 6c 65 6d 73 |ecurity |problems|
|00003720| 20 65 78 69 73 74 2e 0a | 58 0a 58 2e 42 20 6b 75 | exist..|X.X.B ku|
|00003730| 61 6e 67 20 0a 58 63 6f | 6e 74 61 69 6e 73 20 65 |ang .Xco|ntains e|
|00003740| 6d 62 65 64 64 65 64 20 | 72 75 6c 65 73 20 74 68 |mbedded |rules th|
|00003750| 61 74 20 64 65 73 63 72 | 69 62 65 20 74 68 65 20 |at descr|ibe the |
|00003760| 70 72 6f 6a 65 63 74 69 | 6f 6e 20 6d 6f 64 65 6c |projecti|on model|
|00003770| 20 61 6e 64 0a 58 73 6f | 6d 65 20 6f 66 20 74 68 | and.Xso|me of th|
|00003780| 65 20 61 74 74 61 63 6b | 65 72 20 74 72 69 63 6b |e attack|er trick|
|00003790| 73 20 75 73 65 64 20 6f | 6e 20 55 6e 69 78 20 73 |s used o|n Unix s|
|000037a0| 79 73 74 65 6d 73 2e 20 | 20 49 74 20 75 73 65 73 |ystems. | It uses|
|000037b0| 20 74 68 65 73 65 20 72 | 75 6c 65 73 0a 58 74 6f | these r|ules.Xto|
|000037c0| 20 72 65 61 73 6f 6e 20 | 62 61 63 6b 77 61 72 64 | reason |backward|
|000037d0| 20 66 72 6f 6d 20 61 20 | 64 65 73 69 72 65 64 20 | from a |desired |
|000037e0| 67 6f 61 6c 20 28 73 75 | 63 68 20 61 73 20 22 67 |goal (su|ch as "g|
|000037f0| 72 61 6e 74 20 75 2e 72 | 6f 6f 74 22 29 2c 0a 58 |rant u.r|oot"),.X|
|00003800| 67 65 6e 65 72 61 74 69 | 6e 67 20 70 6f 74 65 6e |generati|ng poten|
|00003810| 74 69 61 6c 20 22 61 74 | 74 61 63 6b 22 20 70 6c |tial "at|tack" pl|
|00003820| 61 6e 73 20 66 72 6f 6d | 20 74 68 65 20 72 75 6c |ans from| the rul|
|00003830| 65 73 20 61 6e 64 20 66 | 69 6c 65 20 73 79 73 74 |es and f|ile syst|
|00003840| 65 6d 0a 58 73 74 61 74 | 65 20 61 6e 64 20 74 68 |em.Xstat|e and th|
|00003850| 65 6e 20 65 76 61 6c 75 | 61 74 69 6e 67 20 74 68 |en evalu|ating th|
|00003860| 65 6d 20 74 6f 20 73 65 | 65 20 77 68 65 74 68 65 |em to se|e whethe|
|00003870| 72 20 74 68 65 79 20 61 | 72 65 20 72 65 61 63 68 |r they a|re reach|
|00003880| 61 62 6c 65 0a 58 61 63 | 63 6f 72 64 69 6e 67 20 |able.Xac|cording |
|00003890| 74 6f 20 74 68 65 20 73 | 74 61 74 65 20 72 65 63 |to the s|tate rec|
|000038a0| 6f 72 64 65 64 20 69 6e | 20 74 68 65 20 70 61 73 |orded in| the pas|
|000038b0| 73 77 6f 72 64 20 61 6e | 64 20 67 72 6f 75 70 20 |sword an|d group |
|000038c0| 66 69 6c 65 73 20 61 6e | 64 20 69 6e 0a 58 74 68 |files an|d in.Xth|
|000038d0| 65 20 6f 77 6e 65 72 73 | 68 69 70 20 61 6e 64 20 |e owners|hip and |
|000038e0| 6d 6f 64 65 73 20 6f 66 | 20 74 68 65 20 66 69 6c |modes of| the fil|
|000038f0| 65 20 73 79 73 74 65 6d | 73 2e 0a 58 0a 58 42 79 |e system|s..X.XBy|
|00003900| 20 64 65 66 61 75 6c 74 | 2c 20 0a 58 2e 42 20 6b | default|, .X.B k|
|00003910| 75 61 6e 67 20 0a 58 75 | 73 65 73 20 22 67 72 61 |uang .Xu|ses "gra|
|00003920| 6e 74 20 75 2e 72 6f 6f | 74 22 20 61 73 20 69 74 |nt u.roo|t" as it|
|00003930| 73 20 69 6e 69 74 69 61 | 6c 20 67 6f 61 6c 2e 20 |s initia|l goal. |
|00003940| 20 59 6f 75 20 63 61 6e | 20 63 68 61 6e 67 65 20 | You can| change |
|00003950| 74 68 61 74 20 62 79 0a | 58 73 70 65 63 69 66 79 |that by.|Xspecify|
|00003960| 69 6e 67 20 61 20 75 73 | 65 72 6e 61 6d 65 20 28 |ing a us|ername (|
|00003970| 75 2e 75 73 65 72 6e 61 | 6d 65 29 20 6f 72 20 67 |u.userna|me) or g|
|00003980| 72 6f 75 70 6e 61 6d 65 | 20 28 67 2e 67 72 6f 75 |roupname| (g.grou|
|00003990| 70 6e 61 6d 65 29 20 6f | 6e 20 74 68 65 0a 58 63 |pname) o|n the.Xc|
|000039a0| 6f 6d 6d 61 6e 64 20 6c | 69 6e 65 2e 20 20 4e 6f |ommand l|ine. No|
|000039b0| 72 6d 61 6c 6c 79 20 0a | 58 2e 42 20 6b 75 61 6e |rmally .|X.B kuan|
|000039c0| 67 0a 58 64 65 74 65 72 | 6d 69 6e 65 73 20 61 20 |g.Xdeter|mines a |
|000039d0| 70 6c 61 6e 20 74 6f 20 | 62 65 20 73 75 63 63 65 |plan to |be succe|
|000039e0| 73 73 66 75 6c 20 69 66 | 20 69 74 20 64 65 74 65 |ssful if| it dete|
|000039f0| 72 6d 69 6e 65 73 20 74 | 68 61 74 20 61 6e 79 6f |rmines t|hat anyo|
|00003a00| 6e 65 0a 58 28 75 2e 6f | 74 68 65 72 29 20 63 61 |ne.X(u.o|ther) ca|
|00003a10| 6e 20 62 65 63 6f 6d 65 | 20 74 68 65 20 69 6e 69 |n become| the ini|
|00003a20| 74 69 61 6c 20 67 6f 61 | 6c 2e 20 20 0a 58 0a 58 |tial goa|l. .X.X|
|00003a30| 54 68 65 20 0a 58 2e 42 | 20 5c 2d 76 0a 58 6f 70 |The .X.B| \-v.Xop|
|00003a40| 74 69 6f 6e 20 63 61 75 | 73 65 73 20 0a 58 2e 42 |tion cau|ses .X.B|
|00003a50| 20 6b 75 61 6e 67 0a 58 | 74 6f 20 70 72 69 6e 74 | kuang.X|to print|
|00003a60| 20 61 20 6d 65 73 73 61 | 67 65 20 61 62 6f 75 74 | a messa|ge about|
|00003a70| 20 65 76 65 72 79 20 70 | 6c 61 6e 20 61 64 64 65 | every p|lan adde|
|00003a80| 64 20 74 6f 20 74 68 65 | 20 65 76 61 6c 75 61 74 |d to the| evaluat|
|00003a90| 69 6f 6e 20 6c 69 73 74 | 2e 0a 58 54 68 69 73 20 |ion list|..XThis |
|00003aa0| 63 61 6e 20 68 65 6c 70 | 20 6f 6e 65 20 74 6f 20 |can help| one to |
|00003ab0| 75 6e 64 65 72 73 74 61 | 6e 64 20 68 6f 77 20 0a |understa|nd how .|
|00003ac0| 58 2e 42 20 6b 75 61 6e | 67 20 0a 58 77 6f 72 6b |X.B kuan|g .Xwork|
|00003ad0| 73 2e 20 20 54 68 65 20 | 0a 58 2e 42 20 5c 2d 64 |s. The |.X.B \-d|
|00003ae0| 20 0a 58 6f 70 74 69 6f | 6e 20 63 61 75 73 65 73 | .Xoptio|n causes|
|00003af0| 20 0a 58 2e 42 20 6b 75 | 61 6e 67 0a 58 74 6f 20 | .X.B ku|ang.Xto |
|00003b00| 70 72 69 6e 74 20 61 20 | 6d 65 73 73 61 67 65 20 |print a |message |
|00003b10| 77 68 65 6e 20 69 74 20 | 65 76 61 6c 75 61 74 65 |when it |evaluate|
|00003b20| 73 20 61 20 70 6c 61 6e | 20 74 6f 20 64 65 74 65 |s a plan| to dete|
|00003b30| 72 6d 69 6e 65 20 77 68 | 65 74 68 65 72 20 74 6f |rmine wh|ether to|
|00003b40| 0a 58 72 65 74 61 69 6e | 20 69 74 20 61 6e 64 20 |.Xretain| it and |
|00003b50| 61 64 64 20 6f 6e 74 6f | 20 69 74 20 6f 72 20 69 |add onto| it or i|
|00003b60| 67 6e 6f 72 65 20 69 74 | 2e 20 20 54 68 65 73 65 |gnore it|. These|
|00003b70| 20 6f 70 74 69 6f 6e 73 | 20 77 69 6c 6c 20 6f 66 | options| will of|
|00003b80| 74 65 6e 0a 58 70 72 6f | 64 75 63 65 20 6c 6f 74 |ten.Xpro|duce lot|
|00003b90| 73 20 6f 66 20 6f 75 74 | 70 75 74 2c 20 62 65 77 |s of out|put, bew|
|00003ba0| 61 72 65 2e 0a 58 0a 58 | 4e 6f 72 6d 61 6c 6c 79 |are..X.X|Normally|
|00003bb0| 20 0a 58 2e 42 20 6b 75 | 61 6e 67 0a 58 6f 6e 6c | .X.B ku|ang.Xonl|
|00003bc0| 79 20 72 65 67 69 73 74 | 65 72 73 20 73 75 63 63 |y regist|ers succ|
|00003bd0| 65 73 73 20 77 68 65 6e | 20 69 74 20 66 69 6e 64 |ess when| it find|
|00003be0| 73 20 74 68 61 74 20 65 | 76 65 72 79 6f 6e 65 20 |s that e|veryone |
|00003bf0| 6f 6e 20 74 68 65 20 73 | 79 73 74 65 6d 20 63 61 |on the s|ystem ca|
|00003c00| 6e 0a 58 62 65 63 6f 6d | 65 20 74 68 65 20 74 61 |n.Xbecom|e the ta|
|00003c10| 72 67 65 74 20 75 69 64 | 20 6f 72 20 67 69 64 2e |rget uid| or gid.|
|00003c20| 20 20 57 69 74 68 20 74 | 68 65 20 0a 58 2e 42 20 | With t|he .X.B |
|00003c30| 5c 2d 6c 0a 58 6f 70 74 | 69 6f 6e 2c 20 0a 58 2e |\-l.Xopt|ion, .X.|
|00003c40| 42 20 6b 75 61 6e 67 0a | 58 77 69 6c 6c 20 6c 69 |B kuang.|Xwill li|
|00003c50| 73 74 20 65 76 65 72 79 | 20 75 69 64 20 74 68 61 |st every| uid tha|
|00003c60| 74 20 63 61 6e 20 62 65 | 63 6f 6d 65 20 74 68 65 |t can be|come the|
|00003c70| 20 67 6f 61 6c 2e 20 20 | 54 68 69 73 20 70 72 6f | goal. |This pro|
|00003c80| 76 69 64 65 73 20 61 20 | 6d 6f 72 65 0a 58 63 6f |vides a |more.Xco|
|00003c90| 6d 70 6c 65 74 65 20 70 | 69 63 74 75 72 65 20 6f |mplete p|icture o|
|00003ca0| 66 20 74 68 65 20 73 74 | 61 74 65 20 6f 66 20 73 |f the st|ate of s|
|00003cb0| 65 63 75 72 69 74 79 20 | 2d 20 79 6f 75 20 6d 69 |ecurity |- you mi|
|00003cc0| 67 68 74 20 64 65 65 6d | 20 69 74 20 61 0a 58 70 |ght deem| it a.Xp|
|00003cd0| 72 6f 62 6c 65 6d 20 69 | 66 20 73 65 76 65 72 61 |roblem i|f severa|
|00003ce0| 6c 20 75 73 65 72 73 20 | 63 61 6e 20 62 65 63 6f |l users |can beco|
|00003cf0| 6d 65 20 72 6f 6f 74 2c | 20 65 76 65 6e 20 69 66 |me root,| even if|
|00003d00| 20 74 68 65 20 72 65 73 | 74 20 63 61 6e 6e 6f 74 | the res|t cannot|
|00003d10| 2e 20 20 0a 58 0a 58 4f | 6e 65 20 6d 69 67 68 74 |. .X.XO|ne might|
|00003d20| 20 61 64 6f 70 74 20 74 | 68 65 20 76 69 65 77 20 | adopt t|he view |
|00003d30| 74 68 61 74 20 65 61 63 | 68 20 75 69 64 20 73 68 |that eac|h uid sh|
|00003d40| 6f 75 6c 64 20 6f 6e 6c | 79 20 62 65 20 61 63 63 |ould onl|y be acc|
|00003d50| 65 73 73 69 62 6c 65 20 | 62 79 0a 58 69 74 73 65 |essible |by.Xitse|
|00003d60| 6c 66 20 61 6e 64 20 72 | 6f 6f 74 2c 20 61 6e 64 |lf and r|oot, and|
|00003d70| 20 74 68 61 74 20 65 61 | 63 68 20 67 69 64 20 73 | that ea|ch gid s|
|00003d80| 68 6f 75 6c 64 20 62 65 | 20 61 63 63 65 73 73 69 |hould be| accessi|
|00003d90| 62 6c 65 20 6f 6e 6c 79 | 20 62 79 20 74 68 65 0a |ble only| by the.|
|00003da0| 58 6d 65 6d 62 65 72 73 | 20 6f 66 20 74 68 61 74 |Xmembers| of that|
|00003db0| 20 67 72 6f 75 70 20 61 | 6e 64 20 72 6f 6f 74 2e | group a|nd root.|
|00003dc0| 20 20 4f 6e 65 20 63 61 | 6e 20 74 68 65 6e 20 63 | One ca|n then c|
|00003dd0| 6f 6d 70 61 72 65 20 74 | 68 65 20 65 78 70 65 63 |ompare t|he expec|
|00003de0| 74 65 64 0a 58 61 63 63 | 65 73 73 20 6c 69 73 74 |ted.Xacc|ess list|
|00003df0| 20 66 6f 72 20 61 20 67 | 69 76 65 6e 20 75 69 64 | for a g|iven uid|
|00003e00| 20 6f 72 20 67 69 64 20 | 61 67 61 69 6e 73 74 20 | or gid |against |
|00003e10| 74 68 65 20 0a 58 2e 42 | 20 6b 75 61 6e 67 0a 58 |the .X.B| kuang.X|
|00003e20| 67 65 6e 65 72 61 74 65 | 64 20 6c 69 73 74 20 74 |generate|d list t|
|00003e30| 6f 20 66 69 6e 64 20 73 | 65 63 75 72 69 74 79 20 |o find s|ecurity |
|00003e40| 70 72 6f 62 6c 65 6d 73 | 20 74 68 61 74 20 0a 58 |problems| that .X|
|00003e50| 2e 42 20 6b 75 61 6e 67 | 0a 58 77 6f 75 6c 64 6e |.B kuang|.Xwouldn|
|00003e60| 27 74 20 6f 72 64 69 6e | 61 72 69 6c 79 20 74 65 |'t ordin|arily te|
|00003e70| 6c 6c 20 79 6f 75 20 61 | 62 6f 75 74 2e 0a 58 0a |ll you a|bout..X.|
|00003e80| 58 54 68 65 20 67 6f 61 | 6c 73 20 74 68 61 74 20 |XThe goa|ls that |
|00003e90| 0a 58 2e 42 20 6b 75 61 | 6e 67 0a 58 75 73 65 20 |.X.B kua|ng.Xuse |
|00003ea0| 73 65 65 6d 20 63 72 79 | 70 74 69 63 2c 20 62 75 |seem cry|ptic, bu|
|00003eb0| 74 20 61 72 65 20 72 65 | 61 6c 6c 79 20 70 72 65 |t are re|ally pre|
|00003ec0| 74 74 79 20 73 74 72 61 | 69 67 68 74 66 6f 72 77 |tty stra|ightforw|
|00003ed0| 61 72 64 2e 20 20 45 61 | 63 68 20 67 6f 61 6c 0a |ard. Ea|ch goal.|
|00003ee0| 58 63 6f 6e 73 69 73 74 | 73 20 6f 66 20 61 20 6c |Xconsist|s of a l|
|00003ef0| 69 73 74 20 6f 66 20 3c | 61 63 74 69 6f 6e 3e 20 |ist of <|action> |
|00003f00| 3c 6f 62 6a 65 63 74 3e | 20 70 61 69 72 73 2e 20 |<object>| pairs. |
|00003f10| 20 54 79 70 69 63 61 6c | 20 61 63 74 69 6f 6e 73 | Typical| actions|
|00003f20| 20 61 72 65 0a 58 67 72 | 61 6e 74 2c 20 77 72 69 | are.Xgr|ant, wri|
|00003f30| 74 65 20 61 6e 64 20 72 | 65 70 6c 61 63 65 2e 20 |te and r|eplace. |
|00003f40| 20 54 79 70 69 63 61 6c | 20 6f 62 6a 65 63 74 73 | Typical| objects|
|00003f50| 20 61 72 65 20 75 73 65 | 72 20 6e 61 6d 65 73 0a | are use|r names.|
|00003f60| 58 28 75 2e 75 73 65 72 | 6e 61 6d 65 29 2c 20 67 |X(u.user|name), g|
|00003f70| 72 6f 75 70 20 6e 61 6d | 65 73 20 28 67 2e 67 72 |roup nam|es (g.gr|
|00003f80| 6f 75 70 6e 61 6d 65 29 | 20 61 6e 64 20 66 69 6c |oupname)| and fil|
|00003f90| 65 73 20 6e 61 6d 65 73 | 2e 20 20 54 68 65 20 67 |es names|. The g|
|00003fa0| 6f 61 6c 0a 58 22 67 72 | 61 6e 74 20 75 2e 72 6f |oal.X"gr|ant u.ro|
|00003fb0| 6f 74 22 20 6d 65 61 6e | 73 20 74 6f 20 68 61 76 |ot" mean|s to hav|
|00003fc0| 65 20 61 63 63 65 73 73 | 20 74 6f 20 74 68 65 20 |e access| to the |
|00003fd0| 72 6f 6f 74 20 55 49 44 | 20 28 30 29 2c 20 69 6e |root UID| (0), in|
|00003fe0| 20 6f 74 68 65 72 0a 58 | 77 6f 72 64 73 2c 20 74 | other.X|words, t|
|00003ff0| 6f 20 62 65 20 61 62 6c | 65 20 74 6f 20 72 75 6e |o be abl|e to run|
|00004000| 20 61 6e 79 20 70 72 6f | 67 72 61 6d 20 75 73 69 | any pro|gram usi|
|00004010| 6e 67 20 74 68 61 74 20 | 75 69 64 2e 20 20 53 69 |ng that |uid. Si|
|00004020| 6d 69 6c 61 72 6c 79 2c | 0a 58 22 67 72 61 6e 74 |milarly,|.X"grant|
|00004030| 20 67 2e 73 74 61 66 66 | 22 20 6d 65 61 6e 73 20 | g.staff|" means |
|00004040| 74 6f 20 68 61 76 65 20 | 61 63 63 65 73 73 20 74 |to have |access t|
|00004050| 6f 20 67 72 6f 75 70 20 | 73 74 61 66 66 2e 20 20 |o group |staff. |
|00004060| 54 68 65 20 6c 6f 6e 67 | 20 67 6f 61 6c 0a 58 22 |The long| goal.X"|
|00004070| 67 72 61 6e 74 20 75 2e | 62 69 6c 6c 20 67 72 61 |grant u.|bill gra|
|00004080| 6e 74 20 67 2e 67 72 61 | 70 68 69 63 73 20 72 65 |nt g.gra|phics re|
|00004090| 70 6c 61 63 65 20 2f 6e | 2f 73 68 6f 65 2f 30 2f |place /n|/shoe/0/|
|000040a0| 66 72 65 64 20 72 65 70 | 6c 61 63 65 0a 58 2f 6e |fred rep|lace.X/n|
|000040b0| 2f 73 68 6f 65 2f 30 2f | 66 72 65 64 2f 2e 70 72 |/shoe/0/|fred/.pr|
|000040c0| 6f 66 69 6c 65 20 67 72 | 61 6e 74 20 75 2e 66 72 |ofile gr|ant u.fr|
|000040d0| 65 64 20 67 72 61 6e 74 | 20 67 2e 73 74 61 66 66 |ed grant| g.staff|
|000040e0| 22 20 6d 65 61 6e 73 20 | 62 65 63 6f 6d 65 0a 58 |" means |become.X|
|000040f0| 75 73 65 72 20 62 69 6c | 6c 2c 20 67 65 74 20 61 |user bil|l, get a|
|00004100| 63 63 65 73 73 20 74 6f | 20 74 68 65 20 67 72 61 |ccess to| the gra|
|00004110| 70 68 69 63 73 20 67 72 | 6f 75 70 2c 20 72 65 70 |phics gr|oup, rep|
|00004120| 6c 61 63 65 20 74 68 65 | 20 66 69 6c 65 0a 58 2f |lace the| file.X/|
|00004130| 6e 2f 73 68 6f 65 2f 30 | 2f 66 72 65 64 2c 20 72 |n/shoe/0|/fred, r|
|00004140| 65 70 6c 61 63 65 20 2f | 6e 2f 73 68 6f 65 2f 30 |eplace /|n/shoe/0|
|00004150| 2f 66 72 65 64 2f 2e 70 | 72 6f 66 69 6c 65 2c 20 |/fred/.p|rofile, |
|00004160| 62 65 63 6f 6d 65 20 66 | 72 65 64 2c 0a 58 67 72 |become f|red,.Xgr|
|00004170| 61 6e 74 20 61 63 63 65 | 73 73 20 74 6f 20 74 68 |ant acce|ss to th|
|00004180| 65 20 73 74 61 66 66 20 | 67 72 6f 75 70 2e 20 20 |e staff |group. |
|00004190| 54 68 65 20 70 72 6f 62 | 6c 65 6d 20 74 68 61 74 |The prob|lem that|
|000041a0| 20 61 6c 6c 6f 77 73 20 | 74 68 69 73 20 74 6f 0a | allows |this to.|
|000041b0| 58 68 61 70 70 65 6e 20 | 69 73 20 74 68 61 74 20 |Xhappen |is that |
|000041c0| 74 68 65 20 2f 6e 2f 73 | 68 6f 65 2f 30 20 64 69 |the /n/s|hoe/0 di|
|000041d0| 72 65 63 74 6f 72 79 20 | 69 73 20 77 72 69 74 65 |rectory |is write|
|000041e0| 61 62 6c 65 20 62 79 20 | 74 68 65 20 67 72 61 70 |able by |the grap|
|000041f0| 68 69 63 73 0a 58 67 72 | 6f 75 70 2c 20 6d 65 61 |hics.Xgr|oup, mea|
|00004200| 6e 69 6e 67 20 74 68 61 | 74 20 61 6e 79 6f 6e 65 |ning tha|t anyone|
|00004210| 20 69 6e 20 74 68 61 74 | 20 67 72 6f 75 70 20 63 | in that| group c|
|00004220| 61 6e 20 72 65 70 6c 61 | 63 65 20 74 68 65 20 2e |an repla|ce the .|
|00004230| 70 72 6f 66 69 6c 65 20 | 66 69 6c 65 0a 58 66 6f |profile |file.Xfo|
|00004240| 72 20 74 68 65 20 66 72 | 65 64 20 75 73 65 72 20 |r the fr|ed user |
|00004250| 61 6e 64 20 67 61 69 6e | 20 61 63 63 65 73 73 20 |and gain| access |
|00004260| 74 6f 20 74 68 61 74 20 | 61 63 63 6f 75 6e 74 20 |to that |account |
|00004270| 61 6e 64 20 74 68 65 20 | 67 72 6f 75 70 73 20 69 |and the |groups i|
|00004280| 74 0a 58 62 65 6c 6f 6e | 67 73 20 74 6f 20 77 68 |t.Xbelon|gs to wh|
|00004290| 65 6e 20 66 72 65 64 20 | 6e 65 78 74 20 6c 6f 67 |en fred |next log|
|000042a0| 73 20 69 6e 2e 20 20 4f | 6f 6f 70 73 2e 0a 58 0a |s in. O|oops..X.|
|000042b0| 58 54 6f 20 64 6f 20 61 | 20 74 68 6f 72 6f 75 67 |XTo do a| thoroug|
|000042c0| 68 20 6a 6f 62 2c 20 0a | 58 2e 42 20 6b 75 61 6e |h job, .|X.B kuan|
|000042d0| 67 20 0a 58 72 65 61 6c | 6c 79 20 6e 65 65 64 73 |g .Xreal|ly needs|
|000042e0| 20 74 6f 20 62 65 20 61 | 62 6c 65 20 74 6f 20 61 | to be a|ble to a|
|000042f0| 63 63 65 73 73 20 61 6c | 6c 20 6f 66 0a 58 74 68 |ccess al|l of.Xth|
|00004300| 65 20 63 6f 6e 74 72 6f | 6c 6c 69 6e 67 20 66 69 |e contro|lling fi|
|00004310| 6c 65 73 20 6f 66 20 61 | 6c 6c 20 75 73 65 72 73 |les of a|ll users|
|00004320| 2e 20 20 49 6e 20 73 6f | 6d 65 20 65 6e 76 69 72 |. In so|me envir|
|00004330| 6f 6e 6d 65 6e 74 73 2c | 20 68 6f 6d 65 0a 58 64 |onments,| home.Xd|
|00004340| 69 72 65 63 74 6f 72 69 | 65 73 20 61 72 65 20 6c |irectori|es are l|
|00004350| 6f 63 61 74 65 64 20 69 | 6e 20 4e 46 53 20 6d 6f |ocated i|n NFS mo|
|00004360| 75 6e 74 65 64 20 66 69 | 6c 65 20 73 79 73 74 65 |unted fi|le syste|
|00004370| 6d 73 20 77 68 65 72 65 | 20 74 68 65 20 63 6c 69 |ms where| the cli|
|00004380| 65 6e 74 0a 58 64 6f 65 | 73 6e 27 74 20 68 61 76 |ent.Xdoe|sn't hav|
|00004390| 65 20 72 6f 6f 74 20 61 | 63 63 65 73 73 2e 20 20 |e root a|ccess. |
|000043a0| 0a 58 0a 58 50 72 6f 62 | 6c 65 6d 20 69 73 20 74 |.X.XProb|lem is t|
|000043b0| 68 61 74 20 73 6f 6d 65 | 20 68 6f 6d 65 20 64 69 |hat some| home di|
|000043c0| 72 65 63 74 6f 72 69 65 | 73 20 6d 61 79 20 62 65 |rectorie|s may be|
|000043d0| 0a 58 70 72 6f 74 65 63 | 74 65 64 20 73 6f 20 74 |.Xprotec|ted so t|
|000043e0| 68 61 74 20 67 72 6f 75 | 70 20 66 6f 6f 20 63 61 |hat grou|p foo ca|
|000043f0| 6e 20 72 65 61 64 2f 77 | 72 69 74 65 20 74 68 65 |n read/w|rite the|
|00004400| 6d 2c 20 62 75 74 20 4f | 54 48 45 52 20 63 61 6e |m, but O|THER can|
|00004410| 27 74 2e 0a 58 2e 42 20 | 6b 75 61 6e 67 20 0a 58 |'t..X.B |kuang .X|
|00004420| 72 75 6e 6e 69 6e 67 20 | 61 73 20 73 6f 6d 65 20 |running |as some |
|00004430| 75 73 65 72 20 6e 6f 74 | 20 69 6e 20 67 72 6f 75 |user not| in grou|
|00004440| 70 20 66 6f 6f 20 77 6f | 6e 27 74 20 62 65 20 61 |p foo wo|n't be a|
|00004450| 62 6c 65 20 74 6f 20 72 | 65 61 64 20 6f 72 0a 58 |ble to r|ead or.X|
|00004460| 73 65 61 72 63 68 20 74 | 68 65 20 64 69 72 65 63 |search t|he direc|
|00004470| 74 6f 72 79 2c 20 63 72 | 65 61 74 69 6e 67 20 61 |tory, cr|eating a|
|00004480| 20 62 6c 69 6e 64 20 73 | 70 6f 74 20 74 68 61 74 | blind s|pot that|
|00004490| 20 6d 61 79 20 68 69 64 | 65 20 73 65 63 75 72 69 | may hid|e securi|
|000044a0| 74 79 0a 58 70 72 6f 62 | 6c 65 6d 73 20 28 66 6f |ty.Xprob|lems (fo|
|000044b0| 72 20 65 78 61 6d 70 6c | 65 2c 20 69 66 20 67 72 |r exampl|e, if gr|
|000044c0| 6f 75 70 20 66 6f 6f 20 | 63 61 6e 20 77 72 69 74 |oup foo |can writ|
|000044d0| 65 20 74 68 61 74 20 75 | 73 65 72 27 73 20 2e 6c |e that u|ser's .l|
|000044e0| 6f 67 69 6e 20 61 6e 64 | 0a 58 67 61 69 6e 20 61 |ogin and|.Xgain a|
|000044f0| 63 63 65 73 73 20 74 6f | 20 73 6f 6d 65 20 6f 74 |ccess to| some ot|
|00004500| 68 65 72 20 69 6d 70 6f | 72 74 61 6e 74 20 70 72 |her impo|rtant pr|
|00004510| 69 76 2e 2e 2e 29 20 20 | 52 75 6e 6e 69 6e 67 20 |iv...) |Running |
|00004520| 0a 58 2e 42 20 6b 75 61 | 6e 67 0a 58 61 73 20 72 |.X.B kua|ng.Xas r|
|00004530| 6f 6f 74 0a 58 77 6f 6e | 27 74 20 68 65 6c 70 20 |oot.Xwon|'t help |
|00004540| 75 6e 6c 65 73 73 20 77 | 65 20 61 72 65 20 72 75 |unless w|e are ru|
|00004550| 6e 6e 69 6e 67 20 6f 6e | 20 74 68 65 20 73 65 72 |nning on| the ser|
|00004560| 76 65 72 20 74 68 61 74 | 20 65 78 70 6f 72 74 73 |ver that| exports|
|00004570| 20 74 68 61 74 0a 58 66 | 69 6c 65 20 73 79 73 74 | that.Xf|ile syst|
|00004580| 65 6d 2c 20 73 69 6e 63 | 65 20 72 6f 6f 74 3d 3d |em, sinc|e root==|
|00004590| 6e 6f 62 6f 64 79 20 74 | 68 72 6f 75 67 68 20 4e |nobody t|hrough N|
|000045a0| 46 53 20 68 65 72 65 2e | 20 20 4f 66 20 63 6f 75 |FS here.| Of cou|
|000045b0| 72 73 65 2c 20 74 68 65 | 6e 0a 58 79 6f 75 27 6c |rse, the|n.Xyou'l|
|000045c0| 6c 20 66 69 6e 64 20 6f | 74 68 65 72 20 62 6c 69 |l find o|ther bli|
|000045d0| 6e 64 20 73 70 6f 74 73 | 20 6f 6e 20 6f 74 68 65 |nd spots| on othe|
|000045e0| 72 20 73 65 72 76 65 72 | 73 2c 20 6d 65 61 6e 69 |r server|s, meani|
|000045f0| 6e 67 20 74 68 61 74 20 | 79 6f 75 27 6c 6c 0a 58 |ng that |you'll.X|
|00004600| 6e 65 76 65 72 20 62 65 | 20 61 62 6c 65 20 74 6f |never be| able to|
|00004610| 20 73 65 65 20 61 20 63 | 6f 6d 70 6c 65 74 65 20 | see a c|omplete |
|00004620| 70 69 63 74 75 72 65 20 | 6f 66 20 68 6f 77 20 74 |picture |of how t|
|00004630| 68 69 6e 67 73 20 61 72 | 65 20 66 72 6f 6d 20 61 |hings ar|e from a|
|00004640| 6e 79 0a 58 73 70 6f 74 | 20 6f 6e 20 74 68 65 20 |ny.Xspot| on the |
|00004650| 6e 65 74 2e 20 20 52 75 | 6e 6e 69 6e 67 20 0a 58 |net. Ru|nning .X|
|00004660| 2e 42 20 6b 75 61 6e 67 | 0a 58 6f 6e 20 65 76 65 |.B kuang|.Xon eve|
|00004670| 72 79 20 6d 61 63 68 69 | 6e 65 20 6d 69 67 68 74 |ry machi|ne might|
|00004680| 20 6e 6f 74 20 65 76 65 | 6e 0a 58 68 65 6c 70 2c | not eve|n.Xhelp,|
|00004690| 20 73 69 6e 63 65 20 74 | 68 65 20 62 6c 69 6e 64 | since t|he blind|
|000046a0| 20 73 70 6f 74 73 20 6d | 69 67 68 74 20 70 72 65 | spots m|ight pre|
|000046b0| 76 65 6e 74 20 74 68 65 | 6d 20 66 72 6f 6d 20 73 |vent the|m from s|
|000046c0| 65 65 69 6e 67 20 76 69 | 61 62 6c 65 0a 58 70 61 |eeing vi|able.Xpa|
|000046d0| 74 68 73 20 74 6f 20 53 | 75 63 63 65 73 73 20 6f |ths to S|uccess o|
|000046e0| 6e 20 61 6e 79 20 6f 66 | 20 74 68 65 20 6d 61 63 |n any of| the mac|
|000046f0| 68 69 6e 65 73 2e 20 20 | 53 69 67 68 2e 0a 58 0a |hines. |Sigh..X.|
|00004700| 58 53 6f 6f 6f 6f 20 77 | 65 27 76 65 20 61 64 64 |XSoooo w|e've add|
|00004710| 65 64 20 61 20 0a 58 2e | 42 20 2d 66 20 0a 58 6f |ed a .X.|B -f .Xo|
|00004720| 70 74 69 6f 6e 20 74 68 | 61 74 20 63 61 75 73 65 |ption th|at cause|
|00004730| 73 20 0a 58 2e 42 20 6b | 75 61 6e 67 20 0a 58 74 |s .X.B k|uang .Xt|
|00004740| 6f 20 70 72 65 6c 6f 61 | 64 20 6f 77 6e 65 72 2c |o preloa|d owner,|
|00004750| 20 67 72 6f 75 70 20 61 | 6e 64 20 6d 6f 64 65 20 | group a|nd mode |
|00004760| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 66 6f 72 20 |informat|ion for |
|00004770| 61 20 6c 69 73 74 20 6f | 66 20 66 69 6c 65 73 2e |a list o|f files.|
|00004780| 0a 58 45 61 63 68 20 6c | 69 6e 65 20 6f 66 20 74 |.XEach l|ine of t|
|00004790| 68 65 20 66 69 6c 65 20 | 73 68 6f 75 6c 64 20 62 |he file |should b|
|000047a0| 65 20 6f 66 20 74 68 65 | 20 66 6f 72 6d 20 22 74 |e of the| form "t|
|000047b0| 79 70 65 20 75 69 64 20 | 67 69 64 20 6d 6f 64 65 |ype uid |gid mode|
|000047c0| 20 6e 61 6d 65 22 2e 0a | 58 2e 42 20 74 79 70 65 | name"..|X.B type|
|000047d0| 0a 58 69 73 20 69 67 6e | 6f 72 65 64 20 62 79 20 |.Xis ign|ored by |
|000047e0| 0a 58 2e 42 20 6b 75 61 | 6e 67 2e 0a 58 2e 42 20 |.X.B kua|ng..X.B |
|000047f0| 75 69 64 20 0a 58 61 6e | 64 20 0a 58 2e 42 20 67 |uid .Xan|d .X.B g|
|00004800| 69 64 0a 58 61 72 65 20 | 74 68 65 20 75 73 65 72 |id.Xare |the user|
|00004810| 20 61 6e 64 20 67 72 6f | 75 70 20 49 44 20 6e 75 | and gro|up ID nu|
|00004820| 6d 62 65 72 73 2c 20 69 | 6e 20 64 65 63 69 6d 61 |mbers, i|n decima|
|00004830| 6c 2e 0a 58 2e 42 20 6d | 6f 64 65 0a 58 69 73 20 |l..X.B m|ode.Xis |
|00004840| 74 68 65 20 70 65 72 6d | 69 73 73 69 6f 6e 73 20 |the perm|issions |
|00004850| 66 6f 72 20 74 68 65 20 | 66 69 6c 65 2c 20 69 6e |for the |file, in|
|00004860| 20 6f 63 74 61 6c 2e 20 | 20 41 6e 64 20 0a 58 2e | octal. | And .X.|
|00004870| 42 20 6e 61 6d 65 0a 58 | 69 73 20 74 68 65 20 6e |B name.X|is the n|
|00004880| 61 6d 65 20 6f 66 20 74 | 68 65 20 66 69 6c 65 2e |ame of t|he file.|
|00004890| 20 20 57 65 27 76 65 20 | 61 6c 73 6f 20 61 64 64 | We've |also add|
|000048a0| 65 64 20 61 20 70 72 6f | 67 72 61 6d 20 63 61 6c |ed a pro|gram cal|
|000048b0| 6c 65 64 0a 58 2e 42 20 | 67 65 74 2d 63 66 0a 58 |led.X.B |get-cf.X|
|000048c0| 74 68 61 74 20 63 61 6e | 20 62 65 20 72 75 6e 20 |that can| be run |
|000048d0| 61 73 20 72 6f 6f 74 20 | 6f 6e 20 61 20 73 65 72 |as root |on a ser|
|000048e0| 76 65 72 20 74 6f 20 63 | 72 65 61 74 65 20 61 20 |ver to c|reate a |
|000048f0| 66 69 6c 65 20 6f 66 20 | 74 68 65 20 61 62 6f 76 |file of |the abov|
|00004900| 65 20 66 6f 72 6d 0a 58 | 66 6f 72 20 74 68 65 20 |e form.X|for the |
|00004910| 63 6f 6e 74 72 6f 6c 20 | 66 69 6c 65 73 20 66 6f |control |files fo|
|00004920| 72 20 74 68 65 20 75 73 | 65 72 27 73 20 77 69 74 |r the us|er's wit|
|00004930| 68 20 68 6f 6d 65 20 64 | 69 72 65 63 74 6f 72 69 |h home d|irectori|
|00004940| 65 73 20 6f 6e 20 74 68 | 61 74 0a 58 73 65 72 76 |es on th|at.Xserv|
|00004950| 65 72 2e 20 20 54 68 65 | 6e 20 79 6f 75 20 63 61 |er. The|n you ca|
|00004960| 6e 20 72 75 6e 20 0a 58 | 2e 42 20 67 65 74 2d 63 |n run .X|.B get-c|
|00004970| 66 20 0a 58 6f 6e 20 65 | 76 65 72 79 20 73 65 72 |f .Xon e|very ser|
|00004980| 76 65 72 20 61 73 20 72 | 6f 6f 74 2c 20 63 6f 6e |ver as r|oot, con|
|00004990| 63 61 74 65 6e 61 74 65 | 20 61 6c 6c 20 74 68 65 |catenate| all the|
|000049a0| 20 64 61 74 61 20 74 6f | 67 65 74 68 65 72 2c 20 | data to|gether, |
|000049b0| 61 6e 64 0a 58 70 72 65 | 6c 6f 61 64 20 69 74 20 |and.Xpre|load it |
|000049c0| 69 6e 74 6f 20 50 65 72 | 6c 2e 20 20 54 68 69 73 |into Per|l. This|
|000049d0| 20 77 69 6c 6c 20 66 69 | 78 20 74 68 65 20 73 68 | will fi|x the sh|
|000049e0| 61 64 6f 77 20 70 72 6f | 62 6c 65 6d 73 20 6d 65 |adow pro|blems me|
|000049f0| 6e 74 69 6f 6e 65 64 0a | 58 61 62 6f 76 65 20 61 |ntioned.|Xabove a|
|00004a00| 6e 64 20 73 68 6f 75 6c | 64 20 61 6c 73 6f 20 73 |nd shoul|d also s|
|00004a10| 70 65 65 64 20 74 68 69 | 6e 67 73 20 75 70 20 73 |peed thi|ngs up s|
|00004a20| 69 6e 63 65 20 79 6f 75 | 20 77 6f 6e 27 74 20 6e |ince you| won't n|
|00004a30| 65 65 64 20 74 6f 20 64 | 6f 20 61 6c 6c 0a 58 74 |eed to d|o all.Xt|
|00004a40| 68 65 20 66 69 6c 65 20 | 73 79 73 74 65 6d 20 72 |he file |system r|
|00004a50| 65 66 65 72 65 6e 63 65 | 73 2e 0a 58 0a 58 2e 42 |eference|s..X.X.B|
|00004a60| 20 6b 75 61 6e 67 20 2d | 66 20 66 69 6c 65 0a 58 | kuang -|f file.X|
|00004a70| 77 69 6c 6c 20 75 73 65 | 20 61 20 44 42 4d 20 64 |will use| a DBM d|
|00004a80| 61 74 61 62 61 73 65 20 | 69 6e 20 70 6c 61 63 65 |atabase |in place|
|00004a90| 20 6f 66 20 61 20 74 65 | 78 74 20 66 69 6c 65 20 | of a te|xt file |
|00004aa0| 69 66 20 66 69 6c 65 2e | 64 69 72 20 65 78 69 73 |if file.|dir exis|
|00004ab0| 74 73 2e 0a 58 54 6f 20 | 63 72 65 61 74 65 20 61 |ts..XTo |create a|
|00004ac0| 20 44 42 4d 20 64 61 74 | 61 62 61 73 65 20 66 72 | DBM dat|abase fr|
|00004ad0| 6f 6d 20 61 20 74 65 78 | 74 20 66 69 6c 65 20 6f |om a tex|t file o|
|00004ae0| 66 20 74 68 65 20 66 6f | 72 6d 20 64 65 73 63 72 |f the fo|rm descr|
|00004af0| 69 62 65 64 20 61 62 6f | 76 65 2c 0a 58 75 73 65 |ibed abo|ve,.Xuse|
|00004b00| 20 0a 58 2e 42 20 6b 75 | 61 6e 67 20 2d 66 20 66 | .X.B ku|ang -f f|
|00004b10| 69 6c 65 20 2d 44 2e 0a | 58 54 68 69 73 20 77 69 |ile -D..|XThis wi|
|00004b20| 6c 6c 20 73 75 63 6b 20 | 69 6e 20 74 68 65 20 74 |ll suck |in the t|
|00004b30| 65 78 74 20 66 69 6c 65 | 20 61 6e 64 20 63 72 65 |ext file| and cre|
|00004b40| 61 74 65 20 61 20 44 42 | 4d 20 64 61 74 61 62 61 |ate a DB|M databa|
|00004b50| 73 65 20 66 72 6f 6d 20 | 69 74 20 61 6e 64 0a 58 |se from |it and.X|
|00004b60| 71 75 69 74 2e 20 20 54 | 68 69 73 20 73 70 65 65 |quit. T|his spee|
|00004b70| 64 73 20 75 70 20 6b 75 | 61 6e 67 27 73 20 69 6e |ds up ku|ang's in|
|00004b80| 69 74 69 61 6c 69 7a 61 | 74 69 6f 6e 20 73 6f 6d |itializa|tion som|
|00004b90| 65 77 68 61 74 2c 20 74 | 68 6f 75 67 68 20 69 74 |ewhat, t|hough it|
|00004ba0| 20 69 73 6e 27 74 0a 58 | 63 6c 65 61 72 20 74 68 | isn't.X|clear th|
|00004bb0| 61 74 20 69 74 73 20 77 | 6f 72 74 68 20 64 6f 69 |at its w|orth doi|
|00004bc0| 6e 67 20 75 6e 6c 65 73 | 73 20 79 6f 75 20 68 61 |ng unles|s you ha|
|00004bd0| 76 65 20 61 20 6c 6f 63 | 61 6c 20 64 69 73 6b 20 |ve a loc|al disk |
|00004be0| 66 6f 72 20 74 68 65 20 | 44 42 4d 0a 58 66 69 6c |for the |DBM.Xfil|
|00004bf0| 65 2e 20 0a 58 0a 58 2e | 53 48 20 22 53 45 45 20 |e. .X.X.|SH "SEE |
|00004c00| 41 4c 53 4f 22 0a 58 22 | 52 75 6c 65 20 42 61 73 |ALSO".X"|Rule Bas|
|00004c10| 65 64 20 41 6e 61 6c 79 | 73 69 73 20 6f 66 20 43 |ed Analy|sis of C|
|00004c20| 6f 6d 70 75 74 65 72 20 | 53 65 63 75 72 69 74 79 |omputer |Security|
|00004c30| 22 2c 20 52 6f 62 65 72 | 74 20 57 2e 20 42 61 6c |", Rober|t W. Bal|
|00004c40| 64 77 69 6e 2c 20 4d 49 | 54 2c 20 4a 75 6e 65 20 |dwin, MI|T, June |
|00004c50| 31 39 38 37 2e 0a 58 2e | 53 48 20 4e 4f 54 45 53 |1987..X.|SH NOTES|
|00004c60| 0a 58 2e 4c 50 0a 58 54 | 68 69 73 20 76 65 72 73 |.X.LP.XT|his vers|
|00004c70| 69 6f 6e 20 6f 66 20 0a | 58 2e 42 20 6b 75 61 6e |ion of .|X.B kuan|
|00004c80| 67 0a 58 69 73 20 62 61 | 73 65 64 20 6f 6e 20 74 |g.Xis ba|sed on t|
|00004c90| 68 65 20 73 68 65 6c 6c | 20 73 63 72 69 70 74 20 |he shell| script |
|00004ca0| 76 65 72 73 69 6f 6e 73 | 20 74 68 61 74 20 44 61 |versions| that Da|
|00004cb0| 6e 20 46 61 72 6d 65 72 | 20 69 6e 63 6c 75 64 65 |n Farmer| include|
|00004cc0| 64 20 77 69 74 68 0a 58 | 74 68 65 20 0a 58 2e 42 |d with.X|the .X.B|
|00004cd0| 20 43 4f 50 53 20 0a 58 | 73 65 63 75 72 69 74 79 | COPS .X|security|
|00004ce0| 20 70 61 63 6b 61 67 65 | 2c 20 77 68 69 63 68 20 | package|, which |
|00004cf0| 69 6e 20 74 75 72 6e 20 | 77 65 72 65 20 62 61 73 |in turn |were bas|
|00004d00| 65 64 20 6f 6e 20 63 6f | 64 65 20 77 72 69 74 74 |ed on co|de writt|
|00004d10| 65 6e 20 62 79 20 20 52 | 6f 62 65 72 74 0a 58 42 |en by R|obert.XB|
|00004d20| 61 6c 64 77 69 6e 20 68 | 69 6d 73 65 6c 66 2e 0a |aldwin h|imself..|
|00004d30| 58 0a 58 59 6f 75 20 73 | 68 6f 75 6c 64 20 72 65 |X.XYou s|hould re|
|00004d40| 61 64 20 74 68 65 20 6f | 74 68 65 72 20 64 6f 63 |ad the o|ther doc|
|00004d50| 75 6d 65 6e 74 61 74 69 | 6f 6e 20 74 68 61 74 20 |umentati|on that |
|00004d60| 73 68 6f 75 6c 64 20 63 | 6f 6d 65 20 77 69 74 68 |should c|ome with|
|00004d70| 20 74 68 69 73 0a 58 76 | 65 72 73 69 6f 6e 20 61 | this.Xv|ersion a|
|00004d80| 6e 64 20 6d 6f 64 69 66 | 79 20 74 68 65 20 72 75 |nd modif|y the ru|
|00004d90| 6c 65 73 20 69 6e 20 0a | 58 2e 42 20 6b 75 61 6e |les in .|X.B kuan|
|00004da0| 67 0a 58 74 6f 20 73 75 | 69 74 65 20 79 6f 75 72 |g.Xto su|ite your|
|00004db0| 20 73 69 74 65 2e 0a 58 | 0a 58 2e 53 48 20 42 55 | site..X|.X.SH BU|
|00004dc0| 47 53 0a 58 2e 4c 50 0a | 58 54 68 65 20 72 75 6c |GS.X.LP.|XThe rul|
|00004dd0| 65 73 20 73 68 6f 75 6c | 64 20 62 65 20 65 78 74 |es shoul|d be ext|
|00004de0| 72 61 63 74 65 64 20 66 | 72 6f 6d 20 74 68 65 20 |racted f|rom the |
|00004df0| 63 6f 64 65 20 73 6f 20 | 74 68 61 74 20 74 68 65 |code so |that the|
|00004e00| 79 20 63 6f 75 6c 64 20 | 62 65 0a 58 61 75 67 6d |y could |be.Xaugm|
|00004e10| 65 6e 74 65 64 20 69 6e | 20 61 20 73 69 74 65 20 |ented in| a site |
|00004e20| 73 70 65 63 69 66 69 63 | 20 66 61 73 68 69 6f 6e |specific| fashion|
|00004e30| 20 6d 6f 72 65 20 72 65 | 61 64 69 6c 79 2e 0a 58 | more re|adily..X|
|00004e40| 0a 58 54 68 65 20 73 79 | 73 74 65 6d 20 64 6f 65 |.XThe sy|stem doe|
|00004e50| 73 6e 27 74 20 77 6f 72 | 6b 20 63 6f 72 72 65 63 |sn't wor|k correc|
|00004e60| 74 6c 79 20 77 68 65 6e | 20 6d 75 6c 74 69 70 6c |tly when| multipl|
|00004e70| 65 20 75 73 65 72 73 20 | 69 6e 20 74 68 65 20 70 |e users |in the p|
|00004e80| 61 73 73 77 6f 72 64 0a | 58 66 69 6c 65 20 73 68 |assword.|Xfile sh|
|00004e90| 61 72 65 20 74 68 65 20 | 73 61 6d 65 20 55 49 44 |are the |same UID|
|00004ea0| 2e 20 20 49 6e 20 74 68 | 61 74 20 65 76 65 6e 74 |. In th|at event|
|00004eb0| 2c 20 69 74 20 6f 6e 6c | 79 20 63 68 65 63 6b 73 |, it onl|y checks|
|00004ec0| 20 70 6c 61 6e 73 20 66 | 6f 72 20 74 68 65 0a 58 | plans f|or the.X|
|00004ed0| 66 69 72 73 74 2e 20 0a | 53 48 41 52 5f 45 4f 46 |first. .|SHAR_EOF|
|00004ee0| 0a 63 68 6d 6f 64 20 30 | 36 30 30 20 6b 75 61 6e |.chmod 0|600 kuan|
|00004ef0| 67 2e 31 20 7c 7c 0a 65 | 63 68 6f 20 27 72 65 73 |g.1 ||.e|cho 'res|
|00004f00| 74 6f 72 65 20 6f 66 20 | 6b 75 61 6e 67 2e 31 20 |tore of |kuang.1 |
|00004f10| 66 61 69 6c 65 64 27 0a | 57 63 5f 63 3d 22 60 77 |failed'.|Wc_c="`w|
|00004f20| 63 20 2d 63 20 3c 20 27 | 6b 75 61 6e 67 2e 31 27 |c -c < '|kuang.1'|
|00004f30| 60 22 0a 74 65 73 74 20 | 36 34 39 30 20 2d 65 71 |`".test |6490 -eq|
|00004f40| 20 22 24 57 63 5f 63 22 | 20 7c 7c 0a 09 65 63 68 | "$Wc_c"| ||..ech|
|00004f50| 6f 20 27 6b 75 61 6e 67 | 2e 31 3a 20 6f 72 69 67 |o 'kuang|.1: orig|
|00004f60| 69 6e 61 6c 20 73 69 7a | 65 20 36 34 39 30 2c 20 |inal siz|e 6490, |
|00004f70| 63 75 72 72 65 6e 74 20 | 73 69 7a 65 27 20 22 24 |current |size' "$|
|00004f80| 57 63 5f 63 22 0a 66 69 | 0a 23 20 3d 3d 3d 3d 3d |Wc_c".fi|.# =====|
|00004f90| 3d 3d 3d 3d 3d 3d 3d 3d | 20 6b 75 61 6e 67 2e 70 |========| kuang.p|
|00004fa0| 6c 20 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |l ======|========|
|00004fb0| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 6b 75 61 |.if test| -f 'kua|
|00004fc0| 6e 67 2e 70 6c 27 20 2d | 61 20 58 22 24 31 22 20 |ng.pl' -|a X"$1" |
|00004fd0| 21 3d 20 58 22 2d 63 22 | 3b 20 74 68 65 6e 0a 09 |!= X"-c"|; then..|
|00004fe0| 65 63 68 6f 20 27 78 20 | 2d 20 73 6b 69 70 70 69 |echo 'x |- skippi|
|00004ff0| 6e 67 20 6b 75 61 6e 67 | 2e 70 6c 20 28 46 69 6c |ng kuang|.pl (Fil|
|00005000| 65 20 61 6c 72 65 61 64 | 79 20 65 78 69 73 74 73 |e alread|y exists|
|00005010| 29 27 0a 65 6c 73 65 0a | 65 63 68 6f 20 27 78 20 |)'.else.|echo 'x |
|00005020| 2d 20 65 78 74 72 61 63 | 74 69 6e 67 20 6b 75 61 |- extrac|ting kua|
|00005030| 6e 67 2e 70 6c 20 28 54 | 65 78 74 29 27 0a 73 65 |ng.pl (T|ext)'.se|
|00005040| 64 20 27 73 2f 5e 58 2f | 2f 27 20 3c 3c 20 27 53 |d 's/^X/|/' << 'S|
|00005050| 48 41 52 5f 45 4f 46 27 | 20 3e 20 27 6b 75 61 6e |HAR_EOF'| > 'kuan|
|00005060| 67 2e 70 6c 27 20 26 26 | 0a 58 23 21 20 2f 75 73 |g.pl' &&|.X#! /us|
|00005070| 72 2f 6c 6f 63 61 6c 2f | 62 69 6e 2f 70 65 72 6c |r/local/|bin/perl|
|00005080| 0a 58 0a 58 23 0a 58 23 | 20 6b 75 61 6e 67 20 2d |.X.X#.X#| kuang -|
|00005090| 20 72 75 6c 65 20 62 61 | 73 65 64 20 61 6e 61 6c | rule ba|sed anal|
|000050a0| 79 73 69 73 20 6f 66 20 | 55 6e 69 78 20 73 65 63 |ysis of |Unix sec|
|000050b0| 75 72 69 74 79 0a 58 23 | 0a 58 23 20 50 65 72 6c |urity.X#|.X# Perl|
|000050c0| 20 76 65 72 73 69 6f 6e | 20 62 79 20 53 74 65 76 | version| by Stev|
|000050d0| 65 20 52 6f 6d 69 67 20 | 6f 66 20 74 68 65 20 43 |e Romig |of the C|
|000050e0| 49 53 20 64 65 70 61 72 | 74 6d 65 6e 74 2c 20 54 |IS depar|tment, T|
|000050f0| 68 65 20 4f 68 69 6f 20 | 53 74 61 74 65 0a 58 23 |he Ohio |State.X#|
|00005100| 20 55 6e 69 76 65 72 73 | 69 74 79 2c 20 4f 63 74 | Univers|ity, Oct|
|00005110| 6f 62 65 72 20 31 39 39 | 30 2e 20 0a 58 23 20 0a |ober 199|0. .X# .|
|00005120| 58 23 20 42 61 73 65 64 | 20 6f 6e 20 74 68 65 20 |X# Based| on the |
|00005130| 73 68 65 6c 6c 20 73 63 | 72 69 70 74 20 76 65 72 |shell sc|ript ver|
|00005140| 73 69 6f 6e 20 62 79 20 | 44 61 6e 20 46 61 72 6d |sion by |Dan Farm|
|00005150| 65 72 20 66 72 6f 6d 20 | 68 69 73 20 43 4f 50 53 |er from |his COPS|
|00005160| 0a 58 23 20 70 61 63 6b | 61 67 65 2c 20 77 68 69 |.X# pack|age, whi|
|00005170| 63 68 20 69 6e 20 74 75 | 72 6e 20 69 73 20 62 61 |ch in tu|rn is ba|
|00005180| 73 65 64 20 6f 6e 20 61 | 20 73 68 65 6c 6c 20 76 |sed on a| shell v|
|00005190| 65 72 73 69 6f 6e 20 62 | 79 20 52 6f 62 65 72 74 |ersion b|y Robert|
|000051a0| 0a 58 23 20 42 61 6c 64 | 77 69 6e 2e 20 0a 58 23 |.X# Bald|win. .X#|
|000051b0| 0a 58 0a 58 64 6f 20 27 | 79 61 67 72 69 70 2e 70 |.X.Xdo '|yagrip.p|
|000051c0| 6c 27 20 7c 7c 0a 58 20 | 20 64 69 65 20 22 63 61 |l' ||.X | die "ca|
|000051d0| 6e 27 74 20 64 6f 20 79 | 61 67 72 69 70 2e 70 6c |n't do y|agrip.pl|
|000051e0| 22 3b 0a 58 0a 58 24 6f | 70 74 69 6f 6e 73 20 3d |";.X.X$o|ptions =|
|000051f0| 20 22 76 64 6c 66 3a 44 | 22 3b 0a 58 24 75 73 61 | "vdlf:D|";.X$usa|
|00005200| 67 65 20 3d 20 22 75 73 | 61 67 65 3a 20 6b 75 61 |ge = "us|age: kua|
|00005210| 6e 67 20 5b 2d 76 5d 20 | 5b 2d 64 5d 20 5b 2d 6c |ng [-v] |[-d] [-l|
|00005220| 5d 20 5b 2d 44 5d 20 5b | 2d 66 20 66 69 6c 65 64 |] [-D] [|-f filed|
|00005230| 61 74 61 5d 20 5b 75 2e | 75 73 65 72 6e 61 6d 65 |ata] [u.|username|
|00005240| 7c 67 2e 67 72 6f 75 70 | 6e 61 6d 65 5d 5c 6e 22 ||g.group|name]\n"|
|00005250| 3b 0a 58 0a 58 23 0a 58 | 23 20 53 69 6d 70 6c 65 |;.X.X#.X|# Simple|
|00005260| 20 55 6e 69 78 20 4b 75 | 61 6e 67 2c 20 61 20 73 | Unix Ku|ang, a s|
|00005270| 65 63 75 72 69 74 79 20 | 63 68 65 63 6b 69 6e 67 |ecurity |checking|
|00005280| 20 70 72 6f 67 72 61 6d | 2e 0a 58 23 0a 58 23 20 | program|..X#.X# |
|00005290| 54 68 69 73 20 69 73 20 | 61 20 70 65 72 6c 20 76 |This is |a perl v|
|000052a0| 65 72 73 69 6f 6e 20 6f | 66 20 44 61 6e 20 46 61 |ersion o|f Dan Fa|
|000052b0| 72 6d 65 72 27 73 20 76 | 65 72 73 69 6f 6e 20 6f |rmer's v|ersion o|
|000052c0| 66 20 42 6f 62 20 42 61 | 6c 64 77 69 6e 27 73 0a |f Bob Ba|ldwin's.|
|000052d0| 58 23 20 73 68 65 6c 6c | 20 73 63 72 69 70 74 73 |X# shell| scripts|
|000052e0| 2e 20 0a 58 23 0a 58 0a | 58 23 0a 58 23 20 70 61 |. .X#.X.|X#.X# pa|
|000052f0| 73 73 77 64 5f 62 79 75 | 69 64 20 6c 6f 6f 6b 75 |sswd_byu|id looku|
|00005300| 70 20 61 20 70 61 73 73 | 77 6f 72 64 20 65 6e 74 |p a pass|word ent|
|00005310| 72 79 20 62 79 20 75 69 | 64 2c 20 72 65 74 75 72 |ry by ui|d, retur|
|00005320| 6e 20 61 73 20 0a 58 23 | 20 28 6e 61 6d 65 2c 20 |n as .X#| (name, |
|00005330| 70 61 73 73 77 6f 72 64 | 2c 20 64 69 72 65 63 74 |password|, direct|
|00005340| 6f 72 79 2c 20 73 68 65 | 6c 6c 29 20 6c 69 73 74 |ory, she|ll) list|
|00005350| 2e 0a 58 23 0a 58 73 75 | 62 20 70 61 73 73 77 64 |..X#.Xsu|b passwd|
|00005360| 5f 62 79 75 69 64 20 7b | 0a 58 20 20 20 20 6c 6f |_byuid {|.X lo|
|00005370| 63 61 6c 28 24 75 69 64 | 29 20 3d 20 40 5f 3b 0a |cal($uid|) = @_;.|
|00005380| 58 20 20 20 20 6c 6f 63 | 61 6c 28 24 6e 61 6d 65 |X loc|al($name|
|00005390| 2c 20 24 70 61 73 73 77 | 64 2c 20 24 67 69 64 2c |, $passw|d, $gid,|
|000053a0| 20 24 71 75 6f 74 61 2c | 20 24 63 6f 6d 6d 65 6e | $quota,| $commen|
|000053b0| 74 2c 20 24 67 63 6f 73 | 2c 20 24 64 69 72 2c 20 |t, $gcos|, $dir, |
|000053c0| 24 73 68 65 6c 6c 29 3b | 0a 58 0a 58 20 20 20 20 |$shell);|.X.X |
|000053d0| 69 66 20 28 21 20 64 65 | 66 69 6e 65 64 28 24 70 |if (! de|fined($p|
|000053e0| 61 73 73 77 64 5f 62 79 | 75 69 64 5f 6c 69 73 74 |asswd_by|uid_list|
|000053f0| 7b 24 75 69 64 7d 29 29 | 20 7b 0a 58 09 28 24 6e |{$uid}))| {.X.($n|
|00005400| 61 6d 65 2c 20 24 70 61 | 73 73 77 64 2c 20 24 74 |ame, $pa|sswd, $t|
|00005410| 5f 75 69 64 2c 20 24 67 | 69 64 2c 20 24 71 75 6f |_uid, $g|id, $quo|
|00005420| 74 61 2c 20 24 63 6f 6d | 6d 65 6e 74 2c 20 24 67 |ta, $com|ment, $g|
|00005430| 63 6f 73 2c 20 24 64 69 | 72 2c 20 24 73 68 65 6c |cos, $di|r, $shel|
|00005440| 6c 29 20 3d 0a 58 09 20 | 20 20 20 67 65 74 70 77 |l) =.X. | getpw|
|00005450| 75 69 64 28 24 75 69 64 | 29 3b 0a 58 0a 58 09 69 |uid($uid|);.X.X.i|
|00005460| 66 20 28 24 74 5f 75 69 | 64 20 65 71 20 22 22 29 |f ($t_ui|d eq "")|
|00005470| 20 7b 0a 58 09 20 20 20 | 20 72 65 74 75 72 6e 28 | {.X. | return(|
|00005480| 29 3b 0a 58 09 7d 0a 58 | 0a 58 09 24 70 61 73 73 |);.X.}.X|.X.$pass|
|00005490| 77 64 5f 62 79 75 69 64 | 5f 6c 69 73 74 7b 24 75 |wd_byuid|_list{$u|
|000054a0| 69 64 7d 20 3d 20 6a 6f | 69 6e 28 27 3a 27 2c 20 |id} = jo|in(':', |
|000054b0| 24 6e 61 6d 65 2c 20 24 | 70 61 73 73 77 64 2c 20 |$name, $|passwd, |
|000054c0| 24 64 69 72 2c 20 24 73 | 68 65 6c 6c 29 3b 0a 58 |$dir, $s|hell);.X|
|000054d0| 09 24 70 61 73 73 77 64 | 5f 62 79 6e 61 6d 65 5f |.$passwd|_byname_|
|000054e0| 6c 69 73 74 7b 24 6e 61 | 6d 65 7d 20 3d 20 24 75 |list{$na|me} = $u|
|000054f0| 69 64 3b 0a 58 20 20 20 | 20 7d 0a 58 0a 58 20 20 |id;.X | }.X.X |
|00005500| 20 20 72 65 74 75 72 6e | 28 73 70 6c 69 74 28 2f | return|(split(/|
|00005510| 3a 2f 2c 20 24 70 61 73 | 73 77 64 5f 62 79 75 69 |:/, $pas|swd_byui|
|00005520| 64 5f 6c 69 73 74 7b 24 | 75 69 64 7d 29 29 3b 0a |d_list{$|uid}));.|
|00005530| 58 7d 0a 58 0a 58 73 75 | 62 20 70 61 73 73 77 64 |X}.X.Xsu|b passwd|
|00005540| 5f 62 79 6e 61 6d 65 20 | 7b 0a 58 20 20 20 20 6c |_byname |{.X l|
|00005550| 6f 63 61 6c 28 24 6e 61 | 6d 65 29 20 3d 20 40 5f |ocal($na|me) = @_|
|00005560| 3b 0a 58 20 20 20 20 6c | 6f 63 61 6c 28 24 70 61 |;.X l|ocal($pa|
|00005570| 73 73 77 64 2c 20 24 75 | 69 64 2c 20 24 67 69 64 |sswd, $u|id, $gid|
|00005580| 2c 20 24 71 75 6f 74 61 | 2c 20 24 63 6f 6d 6d 65 |, $quota|, $comme|
|00005590| 6e 74 2c 20 24 67 63 6f | 73 2c 20 24 64 69 72 2c |nt, $gco|s, $dir,|
|000055a0| 20 24 73 68 65 6c 6c 29 | 3b 0a 58 0a 58 20 20 20 | $shell)|;.X.X |
|000055b0| 20 69 66 20 28 21 20 64 | 65 66 69 6e 65 64 28 24 | if (! d|efined($|
|000055c0| 70 61 73 73 77 64 5f 62 | 79 6e 61 6d 65 5f 6c 69 |passwd_b|yname_li|
|000055d0| 73 74 7b 24 6e 61 6d 65 | 7d 29 29 20 7b 0a 58 09 |st{$name|})) {.X.|
|000055e0| 28 24 6e 61 6d 65 2c 20 | 24 70 61 73 73 77 64 2c |($name, |$passwd,|
|000055f0| 20 24 75 69 64 2c 20 24 | 67 69 64 2c 20 24 71 75 | $uid, $|gid, $qu|
|00005600| 6f 74 61 2c 20 24 63 6f | 6d 6d 65 6e 74 2c 20 24 |ota, $co|mment, $|
|00005610| 67 63 6f 73 2c 20 24 64 | 69 72 2c 20 24 73 68 65 |gcos, $d|ir, $she|
|00005620| 6c 6c 29 20 3d 0a 58 09 | 20 20 20 20 67 65 74 70 |ll) =.X.| getp|
|00005630| 77 6e 61 6d 28 24 6e 61 | 6d 65 29 3b 0a 58 0a 58 |wnam($na|me);.X.X|
|00005640| 09 69 66 20 28 24 75 69 | 64 20 65 71 20 22 22 29 |.if ($ui|d eq "")|
|00005650| 20 7b 0a 58 09 20 20 20 | 20 72 65 74 75 72 6e 28 | {.X. | return(|
|00005660| 29 3b 0a 58 09 7d 0a 58 | 0a 58 09 24 70 61 73 73 |);.X.}.X|.X.$pass|
|00005670| 77 64 5f 62 79 75 69 64 | 5f 6c 69 73 74 7b 24 75 |wd_byuid|_list{$u|
|00005680| 69 64 7d 20 3d 20 6a 6f | 69 6e 28 27 3a 27 2c 20 |id} = jo|in(':', |
|00005690| 24 6e 61 6d 65 2c 20 24 | 70 61 73 73 77 64 2c 20 |$name, $|passwd, |
|000056a0| 24 64 69 72 2c 20 24 73 | 68 65 6c 6c 29 3b 0a 58 |$dir, $s|hell);.X|
|000056b0| 09 24 70 61 73 73 77 64 | 5f 62 79 6e 61 6d 65 5f |.$passwd|_byname_|
|000056c0| 6c 69 73 74 7b 24 6e 61 | 6d 65 7d 20 3d 20 24 75 |list{$na|me} = $u|
|000056d0| 69 64 3b 0a 58 20 20 20 | 20 7d 0a 58 0a 58 20 20 |id;.X | }.X.X |
|000056e0| 20 20 72 65 74 75 72 6e | 28 24 70 61 73 73 77 64 | return|($passwd|
|000056f0| 5f 62 79 6e 61 6d 65 5f | 6c 69 73 74 7b 24 6e 61 |_byname_|list{$na|
|00005700| 6d 65 7d 29 3b 0a 58 7d | 0a 58 0a 58 23 0a 58 23 |me});.X}|.X.X#.X#|
|00005710| 20 67 72 6f 75 70 5f 62 | 79 67 69 64 20 6c 6f 6f | group_b|ygid loo|
|00005720| 6b 75 70 20 61 20 67 72 | 6f 75 70 20 65 6e 74 72 |kup a gr|oup entr|
|00005730| 79 20 62 79 20 67 69 64 | 2c 20 72 65 74 75 72 6e |y by gid|, return|
|00005740| 20 61 73 20 0a 58 23 20 | 28 6e 61 6d 65 2c 20 6d | as .X# |(name, m|
|00005750| 65 6d 62 65 72 73 29 20 | 6c 69 73 74 2e 0a 58 23 |embers) |list..X#|
|00005760| 0a 58 73 75 62 20 67 72 | 6f 75 70 5f 62 79 67 69 |.Xsub gr|oup_bygi|
|00005770| 64 20 7b 0a 58 20 20 20 | 20 6c 6f 63 61 6c 28 24 |d {.X | local($|
|00005780| 67 69 64 29 20 3d 20 40 | 5f 3b 0a 58 20 20 20 20 |gid) = @|_;.X |
|00005790| 6c 6f 63 61 6c 28 24 6e | 61 6d 65 2c 20 24 74 5f |local($n|ame, $t_|
|000057a0| 70 61 73 73 77 64 2c 20 | 24 74 5f 67 69 64 2c 20 |passwd, |$t_gid, |
|000057b0| 24 6d 65 6d 62 65 72 73 | 29 3b 0a 58 0a 58 20 20 |$members|);.X.X |
|000057c0| 20 20 69 66 20 28 21 20 | 64 65 66 69 6e 65 64 28 | if (! |defined(|
|000057d0| 24 67 72 6f 75 70 5f 62 | 79 67 69 64 5f 6c 69 73 |$group_b|ygid_lis|
|000057e0| 74 7b 24 67 69 64 7d 29 | 29 20 7b 0a 58 09 28 24 |t{$gid})|) {.X.($|
|000057f0| 6e 61 6d 65 2c 20 24 74 | 5f 70 61 73 73 77 64 2c |name, $t|_passwd,|
|00005800| 20 24 74 5f 67 69 64 2c | 20 24 6d 65 6d 62 65 72 | $t_gid,| $member|
|00005810| 73 29 20 3d 20 67 65 74 | 67 72 67 69 64 28 24 67 |s) = get|grgid($g|
|00005820| 69 64 29 3b 0a 58 0a 58 | 09 69 66 20 28 24 74 5f |id);.X.X|.if ($t_|
|00005830| 67 69 64 20 65 71 20 22 | 22 29 20 7b 0a 58 09 20 |gid eq "|") {.X. |
|00005840| 20 20 20 72 65 74 75 72 | 6e 28 29 3b 0a 58 09 7d | retur|n();.X.}|
|00005850| 0a 58 0a 58 09 24 67 72 | 6f 75 70 5f 62 79 67 69 |.X.X.$gr|oup_bygi|
|00005860| 64 5f 6c 69 73 74 7b 24 | 67 69 64 7d 20 3d 20 6a |d_list{$|gid} = j|
|00005870| 6f 69 6e 28 27 3a 27 2c | 20 24 6e 61 6d 65 2c 20 |oin(':',| $name, |
|00005880| 24 6d 65 6d 62 65 72 73 | 29 3b 0a 58 09 24 67 72 |$members|);.X.$gr|
|00005890| 6f 75 70 5f 62 79 6e 61 | 6d 65 5f 6c 69 73 74 7b |oup_byna|me_list{|
|000058a0| 24 6e 61 6d 65 7d 20 3d | 20 24 67 69 64 3b 0a 58 |$name} =| $gid;.X|
|000058b0| 20 20 20 20 7d 0a 58 0a | 58 20 20 20 20 72 65 74 | }.X.|X ret|
|000058c0| 75 72 6e 28 73 70 6c 69 | 74 28 2f 3a 2f 2c 20 24 |urn(spli|t(/:/, $|
|000058d0| 67 72 6f 75 70 5f 62 79 | 67 69 64 5f 6c 69 73 74 |group_by|gid_list|
|000058e0| 7b 24 67 69 64 7d 29 29 | 3b 0a 58 7d 0a 58 0a 58 |{$gid}))|;.X}.X.X|
|000058f0| 73 75 62 20 67 72 6f 75 | 70 5f 62 79 6e 61 6d 65 |sub grou|p_byname|
|00005900| 20 7b 0a 58 20 20 20 20 | 6c 6f 63 61 6c 28 24 6e | {.X |local($n|
|00005910| 61 6d 65 29 20 3d 20 40 | 5f 3b 0a 58 20 20 20 20 |ame) = @|_;.X |
|00005920| 6c 6f 63 61 6c 28 24 67 | 6e 61 6d 65 2c 20 24 70 |local($g|name, $p|
|00005930| 61 73 73 77 64 2c 20 24 | 67 69 64 2c 20 24 6d 65 |asswd, $|gid, $me|
|00005940| 6d 62 65 72 73 29 3b 0a | 58 0a 58 20 20 20 20 69 |mbers);.|X.X i|
|00005950| 66 20 28 21 20 64 65 66 | 69 6e 65 64 28 24 67 72 |f (! def|ined($gr|
|00005960| 6f 75 70 5f 62 79 6e 61 | 6d 65 5f 6c 69 73 74 7b |oup_byna|me_list{|
|00005970| 24 6e 61 6d 65 7d 29 29 | 20 7b 0a 58 09 28 24 67 |$name}))| {.X.($g|
|00005980| 6e 61 6d 65 2c 20 24 70 | 61 73 73 77 64 2c 20 24 |name, $p|asswd, $|
|00005990| 67 69 64 2c 20 24 6d 65 | 6d 62 65 72 73 29 20 3d |gid, $me|mbers) =|
|000059a0| 20 67 65 74 67 72 6e 61 | 6d 28 24 6e 61 6d 65 29 | getgrna|m($name)|
|000059b0| 3b 0a 58 0a 58 09 69 66 | 20 28 24 67 69 64 20 65 |;.X.X.if| ($gid e|
|000059c0| 71 20 22 22 29 20 7b 0a | 58 09 20 20 20 20 70 72 |q "") {.|X. pr|
|000059d0| 69 6e 74 66 28 73 74 64 | 65 72 72 20 22 41 20 67 |intf(std|err "A g|
|000059e0| 72 6f 75 70 20 6e 61 6d | 65 64 20 27 24 6e 61 6d |roup nam|ed '$nam|
|000059f0| 65 27 20 64 6f 65 73 20 | 6e 6f 74 20 65 78 69 73 |e' does |not exis|
|00005a00| 74 21 5c 6e 22 29 3b 0a | 58 09 20 20 20 20 65 78 |t!\n");.|X. ex|
|00005a10| 69 74 28 31 29 3b 0a 58 | 20 20 20 20 20 20 20 20 |it(1);.X| |
|00005a20| 7d 0a 58 0a 58 09 24 67 | 72 6f 75 70 5f 62 79 67 |}.X.X.$g|roup_byg|
|00005a30| 69 64 5f 6c 69 73 74 7b | 24 67 69 64 7d 20 3d 20 |id_list{|$gid} = |
|00005a40| 6a 6f 69 6e 28 27 3a 27 | 2c 20 24 6e 61 6d 65 2c |join(':'|, $name,|
|00005a50| 20 24 6d 65 6d 62 65 72 | 73 29 3b 0a 58 09 24 67 | $member|s);.X.$g|
|00005a60| 72 6f 75 70 5f 62 79 6e | 61 6d 65 5f 6c 69 73 74 |roup_byn|ame_list|
|00005a70| 7b 24 6e 61 6d 65 7d 20 | 3d 20 24 67 69 64 3b 0a |{$name} |= $gid;.|
|00005a80| 58 20 20 20 20 7d 0a 58 | 0a 58 20 20 20 20 72 65 |X }.X|.X re|
|00005a90| 74 75 72 6e 28 24 67 72 | 6f 75 70 5f 62 79 6e 61 |turn($gr|oup_byna|
|00005aa0| 6d 65 5f 6c 69 73 74 7b | 24 6e 61 6d 65 7d 29 3b |me_list{|$name});|
|00005ab0| 0a 58 7d 0a 58 0a 58 23 | 0a 58 23 20 44 6f 20 76 |.X}.X.X#|.X# Do v|
|00005ac0| 61 72 69 6f 75 73 20 69 | 6e 69 74 69 61 6c 69 7a |arious i|nitializ|
|00005ad0| 61 74 69 6f 6e 20 74 79 | 70 65 20 74 68 69 6e 67 |ation ty|pe thing|
|00005ae0| 73 2e 0a 58 23 0a 58 0a | 58 73 75 62 20 69 6e 69 |s..X#.X.|Xsub ini|
|00005af0| 74 5f 6b 75 61 6e 67 20 | 7b 0a 58 20 20 20 20 6c |t_kuang |{.X l|
|00005b00| 6f 63 61 6c 28 24 77 68 | 69 63 68 2c 20 24 6e 61 |ocal($wh|ich, $na|
|00005b10| 6d 65 2c 20 24 75 69 64 | 2c 20 24 67 69 64 29 3b |me, $uid|, $gid);|
|00005b20| 0a 58 20 20 20 20 6c 6f | 63 61 6c 28 24 66 5f 74 |.X lo|cal($f_t|
|00005b30| 79 70 65 2c 20 24 66 5f | 75 69 64 2c 20 24 66 5f |ype, $f_|uid, $f_|
|00005b40| 67 69 64 2c 20 24 66 5f | 6d 6f 64 65 2c 20 24 66 |gid, $f_|mode, $f|
|00005b50| 5f 6e 61 6d 65 29 3b 0a | 58 20 20 20 20 6c 6f 63 |_name);.|X loc|
|00005b60| 61 6c 28 24 63 6f 75 6e | 74 29 3b 0a 58 0a 58 20 |al($coun|t);.X.X |
|00005b70| 20 20 20 24 77 68 69 63 | 68 20 3d 20 22 75 22 3b | $whic|h = "u";|
|00005b80| 0a 58 20 20 20 20 24 6e | 61 6d 65 20 3d 20 22 72 |.X $n|ame = "r|
|00005b90| 6f 6f 74 22 3b 0a 58 0a | 58 20 20 20 20 23 0a 58 |oot";.X.|X #.X|
|00005ba0| 20 20 20 20 23 20 44 65 | 61 6c 20 77 69 74 68 20 | # De|al with |
|00005bb0| 61 72 67 73 2e 2e 2e 0a | 58 20 20 20 20 23 0a 58 |args....|X #.X|
|00005bc0| 0a 58 20 20 20 20 26 67 | 65 74 6f 70 74 28 24 6f |.X &g|etopt($o|
|00005bd0| 70 74 69 6f 6e 73 29 20 | 7c 7c 0a 58 20 20 20 20 |ptions) |||.X |
|00005be0| 20 20 64 69 65 20 24 75 | 73 61 67 65 3b 0a 58 0a | die $u|sage;.X.|
|00005bf0| 58 20 20 20 20 69 66 20 | 28 24 23 41 52 47 56 20 |X if |($#ARGV |
|00005c00| 3d 3d 20 30 29 20 7b 0a | 58 09 28 24 77 68 69 63 |== 0) {.|X.($whic|
|00005c10| 68 2c 20 24 6e 61 6d 65 | 29 20 3d 20 73 70 6c 69 |h, $name|) = spli|
|00005c20| 74 28 2f 5c 2e 2f 2c 20 | 24 41 52 47 56 5b 30 5d |t(/\./, |$ARGV[0]|
|00005c30| 29 3b 0a 58 0a 58 09 69 | 66 20 28 24 6e 61 6d 65 |);.X.X.i|f ($name|
|00005c40| 20 65 71 20 22 22 29 20 | 7b 0a 58 09 20 20 20 20 | eq "") |{.X. |
|00005c50| 24 6e 61 6d 65 20 3d 20 | 24 77 68 69 63 68 3b 0a |$name = |$which;.|
|00005c60| 58 09 20 20 20 20 24 77 | 68 69 63 68 20 3d 20 22 |X. $w|hich = "|
|00005c70| 75 22 3b 0a 58 09 7d 0a | 58 0a 58 09 69 66 20 28 |u";.X.}.|X.X.if (|
|00005c80| 24 77 68 69 63 68 20 6e | 65 20 22 75 22 20 26 26 |$which n|e "u" &&|
|00005c90| 20 24 77 68 69 63 68 20 | 6e 65 20 22 67 22 29 20 | $which |ne "g") |
|00005ca0| 7b 0a 58 09 20 20 20 20 | 70 72 69 6e 74 66 28 73 |{.X. |printf(s|
|00005cb0| 74 64 65 72 72 20 22 74 | 61 72 67 65 74 20 6d 75 |tderr "t|arget mu|
|00005cc0| 73 74 20 62 65 20 67 69 | 76 65 6e 20 61 73 20 75 |st be gi|ven as u|
|00005cd0| 2e 75 73 65 72 20 6f 72 | 20 67 2e 67 72 6f 75 70 |.user or| g.group|
|00005ce0| 5c 6e 22 29 3b 0a 58 09 | 20 20 20 20 65 78 69 74 |\n");.X.| exit|
|00005cf0| 28 31 29 3b 0a 58 09 7d | 0a 58 20 20 20 20 7d 20 |(1);.X.}|.X } |
|00005d00| 65 6c 73 69 66 20 28 24 | 23 41 52 47 56 20 3e 20 |elsif ($|#ARGV > |
|00005d10| 30 29 20 7b 0a 58 09 70 | 72 69 6e 74 66 28 73 74 |0) {.X.p|rintf(st|
|00005d20| 64 65 72 72 20 24 75 73 | 61 67 65 29 3b 0a 58 09 |derr $us|age);.X.|
|00005d30| 65 78 69 74 28 31 29 3b | 0a 58 20 20 20 20 7d 0a |exit(1);|.X }.|
|00005d40| 58 0a 58 20 20 20 20 23 | 0a 58 20 20 20 20 23 20 |X.X #|.X # |
|00005d50| 50 72 65 6c 6f 61 64 20 | 74 68 65 20 66 69 6c 65 |Preload |the file|
|00005d60| 20 64 61 74 61 2e 2e 2e | 0a 58 20 20 20 20 23 0a | data...|.X #.|
|00005d70| 58 20 20 20 20 69 66 20 | 28 64 65 66 69 6e 65 64 |X if |(defined|
|00005d80| 28 24 6f 70 74 5f 66 29 | 29 20 7b 0a 58 09 23 0a |($opt_f)|) {.X.#.|
|00005d90| 58 09 23 20 49 66 20 77 | 65 20 61 72 65 20 64 75 |X.# If w|e are du|
|00005da0| 6d 70 69 6e 67 20 74 68 | 65 20 66 69 6c 65 20 64 |mping th|e file d|
|00005db0| 61 74 61 20 74 6f 20 61 | 20 44 42 4d 20 66 69 6c |ata to a| DBM fil|
|00005dc0| 65 2c 20 6e 75 6b 65 20 | 74 68 65 20 65 78 69 73 |e, nuke |the exis|
|00005dd0| 74 69 6e 67 20 0a 58 09 | 23 20 6f 6e 65 73 20 61 |ting .X.|# ones a|
|00005de0| 6e 64 20 6f 70 65 6e 20 | 74 68 65 20 64 62 6d 20 |nd open |the dbm |
|00005df0| 66 69 6c 65 2e 20 20 4f | 74 68 65 72 77 69 73 65 |file. O|therwise|
|00005e00| 2c 20 6f 70 65 6e 20 74 | 68 65 20 44 42 4d 20 66 |, open t|he DBM f|
|00005e10| 69 6c 65 0a 58 20 09 23 | 20 6f 6e 6c 79 20 69 66 |ile.X .#| only if|
|00005e20| 20 74 68 65 79 20 65 78 | 69 73 74 2e 20 0a 58 09 | they ex|ist. .X.|
|00005e30| 23 0a 58 09 24 72 65 61 | 64 5f 66 72 6f 6d 5f 66 |#.X.$rea|d_from_f|
|00005e40| 69 6c 65 20 3d 20 31 3b | 0a 58 0a 58 09 69 66 20 |ile = 1;|.X.X.if |
|00005e50| 28 64 65 66 69 6e 65 64 | 28 24 6f 70 74 5f 44 29 |(defined|($opt_D)|
|00005e60| 29 20 7b 09 0a 58 09 20 | 20 20 20 75 6e 6c 69 6e |) {..X. | unlin|
|00005e70| 6b 28 22 24 6f 70 74 5f | 66 2e 64 69 72 22 2c 20 |k("$opt_|f.dir", |
|00005e80| 22 24 6f 70 74 5f 66 2e | 70 61 67 22 29 3b 0a 58 |"$opt_f.|pag");.X|
|00005e90| 0a 58 09 20 20 20 20 64 | 62 6d 6f 70 65 6e 28 66 |.X. d|bmopen(f|
|00005ea0| 69 6c 65 73 2c 20 24 6f | 70 74 5f 66 2c 20 30 36 |iles, $o|pt_f, 06|
|00005eb0| 34 34 29 20 7c 7c 0a 58 | 09 20 20 20 20 20 20 64 |44) ||.X|. d|
|00005ec0| 69 65 20 73 70 72 69 6e | 74 66 28 22 63 61 6e 27 |ie sprin|tf("can'|
|00005ed0| 74 20 6f 70 65 6e 20 44 | 42 4d 20 66 69 6c 65 20 |t open D|BM file |
|00005ee0| 27 25 73 27 22 2c 20 24 | 6f 70 74 5f 66 29 3b 0a |'%s'", $|opt_f);.|
|00005ef0| 58 09 7d 20 65 6c 73 69 | 66 20 28 2d 66 20 22 24 |X.} elsi|f (-f "$|
|00005f00| 6f 70 74 5f 66 2e 64 69 | 72 22 29 20 7b 0a 58 09 |opt_f.di|r") {.X.|
|00005f10| 20 20 20 20 64 62 6d 6f | 70 65 6e 28 66 69 6c 65 | dbmo|pen(file|
|00005f20| 73 2c 20 24 6f 70 74 5f | 66 2c 20 30 36 34 34 29 |s, $opt_|f, 0644)|
|00005f30| 20 7c 7c 0a 58 09 20 20 | 20 20 20 20 64 69 65 20 | ||.X. | die |
|00005f40| 73 70 72 69 6e 74 66 28 | 22 63 61 6e 27 74 20 6f |sprintf(|"can't o|
|00005f50| 70 65 6e 20 44 42 4d 20 | 66 69 6c 65 20 27 25 73 |pen DBM |file '%s|
|00005f60| 27 22 2c 20 24 6f 70 74 | 5f 66 29 3b 0a 58 0a 58 |'", $opt|_f);.X.X|
|00005f70| 09 20 20 20 20 24 72 65 | 61 64 5f 66 72 6f 6d 5f |. $re|ad_from_|
|00005f80| 66 69 6c 65 20 3d 20 30 | 3b 0a 58 09 7d 0a 58 0a |file = 0|;.X.}.X.|
|00005f90| 58 09 69 66 20 28 24 72 | 65 61 64 5f 66 72 6f 6d |X.if ($r|ead_from|
|00005fa0| 5f 66 69 6c 65 29 20 7b | 0a 58 09 20 20 20 20 6f |_file) {|.X. o|
|00005fb0| 70 65 6e 28 46 49 4c 45 | 44 41 54 41 2c 20 24 6f |pen(FILE|DATA, $o|
|00005fc0| 70 74 5f 66 29 20 7c 7c | 20 0a 58 09 20 20 20 20 |pt_f) ||| .X. |
|00005fd0| 20 20 64 69 65 20 73 70 | 72 69 6e 74 66 28 22 6b | die sp|rintf("k|
|00005fe0| 75 61 6e 67 3a 20 63 61 | 6e 27 74 20 6f 70 65 6e |uang: ca|n't open|
|00005ff0| 20 27 25 73 27 22 2c 20 | 24 6f 70 74 5f 66 29 3b | '%s'", |$opt_f);|
|00006000| 0a 58 0a 58 09 20 20 20 | 20 24 63 6f 75 6e 74 20 |.X.X. | $count |
|00006010| 3d 20 30 3b 0a 58 09 20 | 20 20 20 77 68 69 6c 65 |= 0;.X. | while|
|00006020| 20 28 3c 46 49 4c 45 44 | 41 54 41 3e 29 20 7b 0a | (<FILED|ATA>) {.|
|00006030| 58 09 09 24 63 6f 75 6e | 74 2b 2b 3b 0a 58 0a 58 |X..$coun|t++;.X.X|
|00006040| 09 09 63 68 6f 70 3b 0a | 58 09 09 28 24 66 5f 74 |..chop;.|X..($f_t|
|00006050| 79 70 65 2c 20 24 66 5f | 75 69 64 2c 20 24 66 5f |ype, $f_|uid, $f_|
|00006060| 67 69 64 2c 20 24 66 5f | 6d 6f 64 65 2c 20 24 66 |gid, $f_|mode, $f|
|00006070| 5f 6e 61 6d 65 29 20 3d | 20 73 70 6c 69 74 3b 0a |_name) =| split;.|
|00006080| 58 0a 58 09 09 69 66 20 | 28 24 63 6f 75 6e 74 20 |X.X..if |($count |
|00006090| 25 20 31 30 30 30 20 3d | 3d 20 30 29 20 7b 0a 58 |% 1000 =|= 0) {.X|
|000060a0| 09 09 20 20 20 20 70 72 | 69 6e 74 66 28 22 6c 69 |.. pr|intf("li|
|000060b0| 6e 65 20 24 63 6f 75 6e | 74 2c 20 72 65 61 64 69 |ne $coun|t, readi|
|000060c0| 6e 67 20 65 6e 74 72 79 | 20 66 6f 72 20 24 66 5f |ng entry| for $f_|
|000060d0| 6e 61 6d 65 5c 6e 22 29 | 3b 0a 58 09 09 7d 0a 58 |name\n")|;.X..}.X|
|000060e0| 09 09 24 66 69 6c 65 73 | 7b 24 66 5f 6e 61 6d 65 |..$files|{$f_name|
|000060f0| 7d 20 3d 20 6a 6f 69 6e | 28 27 20 27 2c 20 24 66 |} = join|(' ', $f|
|00006100| 5f 75 69 64 2c 20 24 66 | 5f 67 69 64 2c 20 24 66 |_uid, $f|_gid, $f|
|00006110| 5f 6d 6f 64 65 29 3b 0a | 58 09 20 20 20 20 7d 0a |_mode);.|X. }.|
|00006120| 58 0a 58 09 20 20 20 20 | 63 6c 6f 73 65 28 46 49 |X.X. |close(FI|
|00006130| 4c 45 44 41 54 41 29 3b | 0a 58 09 7d 0a 58 20 20 |LEDATA);|.X.}.X |
|00006140| 20 20 7d 0a 58 0a 58 20 | 20 20 20 69 66 20 28 64 | }.X.X | if (d|
|00006150| 65 66 69 6e 65 64 28 24 | 6f 70 74 5f 44 29 29 20 |efined($|opt_D)) |
|00006160| 7b 0a 58 09 64 62 6d 63 | 6c 6f 73 65 28 66 69 6c |{.X.dbmc|lose(fil|
|00006170| 65 73 29 3b 0a 58 0a 58 | 09 65 78 69 74 28 30 29 |es);.X.X|.exit(0)|
|00006180| 3b 0a 58 20 20 20 20 7d | 0a 58 69 66 20 28 64 65 |;.X }|.Xif (de|
|00006190| 66 69 6e 65 64 28 24 6f | 70 74 5f 76 29 29 20 7b |fined($o|pt_v)) {|
|000061a0| 0a 58 20 20 20 20 70 72 | 69 6e 74 66 28 22 64 6f |.X pr|intf("do|
|000061b0| 6e 65 20 77 69 74 68 20 | 66 69 6c 65 73 5c 6e 22 |ne with |files\n"|
|000061c0| 29 3b 0a 58 20 20 20 20 | 7d 0a 58 20 20 20 20 23 |);.X |}.X #|
|000061d0| 0a 58 20 20 20 20 23 20 | 4e 65 65 64 20 73 6f 6d |.X # |Need som|
|000061e0| 65 20 6f 66 20 74 68 65 | 20 70 61 73 73 77 6f 72 |e of the| passwor|
|000061f0| 64 20 61 6e 64 20 67 72 | 6f 75 70 20 73 74 75 66 |d and gr|oup stuf|
|00006200| 66 2e 20 20 53 75 63 6b | 20 69 6e 20 70 61 73 73 |f. Suck| in pass|
|00006210| 77 64 20 61 6e 64 20 0a | 58 20 20 20 20 23 20 67 |wd and .|X # g|
|00006220| 72 6f 75 70 20 69 6e 66 | 6f 2c 20 73 74 6f 72 65 |roup inf|o, store|
|00006230| 20 62 79 20 75 69 64 20 | 61 6e 64 20 67 69 64 20 | by uid |and gid |
|00006240| 69 6e 20 61 6e 20 61 73 | 73 6f 63 69 61 74 69 76 |in an as|sociativ|
|00006250| 65 20 61 72 72 61 79 20 | 6f 66 20 73 74 72 69 6e |e array |of strin|
|00006260| 67 73 0a 58 20 20 20 20 | 23 20 77 68 69 63 68 20 |gs.X |# which |
|00006270| 63 6f 6e 73 69 73 74 20 | 6f 66 20 66 69 65 6c 64 |consist |of field|
|00006280| 73 20 63 6f 72 72 65 73 | 70 6f 6e 64 69 6e 67 20 |s corres|ponding |
|00006290| 74 6f 20 74 68 65 20 70 | 61 73 73 77 64 20 61 6e |to the p|asswd an|
|000062a0| 64 20 67 72 6f 75 70 20 | 66 69 6c 65 20 0a 58 20 |d group |file .X |
|000062b0| 20 20 20 23 20 65 6e 74 | 72 69 65 73 20 28 61 6e | # ent|ries (an|
|000062c0| 64 20 77 68 61 74 20 74 | 68 65 20 68 65 63 6b 2c |d what t|he heck,|
|000062d0| 20 77 65 27 6c 6c 20 75 | 73 65 20 3a 20 61 73 20 | we'll u|se : as |
|000062e0| 61 20 64 65 6c 69 6d 69 | 74 65 72 20 61 6c 73 6f |a delimi|ter also|
|000062f0| 2e 2e 2e 3a 2d 29 0a 58 | 20 20 20 20 23 0a 58 0a |...:-).X| #.X.|
|00006300| 58 20 20 20 20 24 70 61 | 73 73 77 64 5f 62 79 75 |X $pa|sswd_byu|
|00006310| 69 64 5f 6c 69 73 74 7b | 2d 31 7d 20 3d 20 22 4f |id_list{|-1} = "O|
|00006320| 54 48 45 52 3a 3a 3a 22 | 3b 09 23 20 61 64 64 20 |THER:::"|;.# add |
|00006330| 61 6e 20 65 6e 74 72 79 | 20 66 6f 72 20 4f 54 48 |an entry| for OTH|
|00006340| 45 52 0a 58 20 20 20 20 | 24 70 61 73 73 77 64 5f |ER.X |$passwd_|
|00006350| 62 79 6e 61 6d 65 5f 6c | 69 73 74 7b 22 4f 54 48 |byname_l|ist{"OTH|
|00006360| 45 52 22 7d 20 3d 20 2d | 31 3b 0a 58 0a 58 20 20 |ER"} = -|1;.X.X |
|00006370| 20 20 24 75 69 64 73 5f | 6b 6e 6f 77 6e 7b 2d 31 | $uids_|known{-1|
|00006380| 7d 20 3d 20 22 22 3b 09 | 09 09 23 20 77 65 20 63 |} = "";.|..# we c|
|00006390| 61 6e 20 61 63 63 65 73 | 73 20 4f 54 48 45 52 0a |an acces|s OTHER.|
|000063a0| 58 20 20 20 20 25 75 69 | 64 73 5f 6e 65 77 20 3d |X %ui|ds_new =|
|000063b0| 20 28 29 3b 0a 58 0a 58 | 20 20 20 20 25 67 69 64 | ();.X.X| %gid|
|000063c0| 73 5f 6b 6e 6f 77 6e 20 | 3d 20 28 29 3b 0a 58 20 |s_known |= ();.X |
|000063d0| 20 20 20 25 67 69 64 73 | 5f 6e 65 77 20 3d 20 28 | %gids|_new = (|
|000063e0| 29 3b 0a 58 0a 58 20 20 | 20 20 25 66 69 6c 65 73 |);.X.X | %files|
|000063f0| 5f 6e 65 77 20 3d 20 28 | 29 3b 0a 58 0a 58 20 20 |_new = (|);.X.X |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.